Skip to content
Back to formatted view

Raw Message

Message-ID: <48C2473E-0EEA-4F3C-BD73-0EEFCD4A16E4@act.ulaval.ca>
Date: 2009-01-23T15:36:31Z
From: Vincent Goulet
Subject: Histogram for grouped data in R
In-Reply-To: <21624806.post@talk.nabble.com>

Le ven. 23 janv. ? 08:55, darthgervais a ?crit :

>
> I have grouped data in this format
>
> Size  -- Count
> 0-10 --  15
> 10-20 -- 25
> 20-50 -- 10
> 50-100 -- 5
>
> I've been trying to find a way to set this up with the proper  
> histogram
> heights, but can't seem to figure it out. So any help would be much
> appreciated!

Define your data as a "grouped.data" object using the function of the  
same name in package actuar. Then you can simply use hist() as usual  
to get what you want. See:

@Article{Rnews:Goulet+Pigeon:2008,
  author = {Vincent Goulet and Mathieu Pigeon},
  title = {Statistical Modeling of Loss Distributions Using actuar},
  journal = {R News},
  year = 2008,
  volume = 8,
  number = 1,
  pages = {34--40},
  month = {May},
  url = http, pdf = Rnews2008-1 }

HTH

---
   Vincent Goulet
   Acting Chair, Associate Professor
   ?cole d'actuariat
   Universit? Laval, Qu?bec
   Vincent.Goulet at act.ulaval.ca   http://vgoulet.act.ulaval.ca