[R] Using R for grouped data based calculations ???

David Winsemius dwinsemius at comcast.net
Tue Aug 23 07:46:51 CEST 2011


On Aug 23, 2011, at 12:34 AM, Amit Jain wrote:

> Hi,
>
> Has Anyone used R for descriptive statistics of Grouped Data. I have
> an example below
>

It seems to be a big night for homework on Rhelp.

> Can someone calculate the Median of the following data using R
>
> Miles Driven             Number of Residents
> 0-2999                        10
> 3000-5999                     28
> 6000-8999                     46
----------
subtotal                       74


> 9000-11,999                  32
> 12,000-14999                 24
> 15000-19,999                 11
> 20000 and over                7
subtotal                       74
>
> what is the median number of miles driven per resident for this  
> sample using R
>
> I can do this manually but I need to figure out this can be done using
> R. I am not looking for an exact solution to this but to some pointers
> or a nice example

Look for wtd.quantile() but since the values are categorical you have  
some further implementation details to address.

-- 
David Winsemius, MD
Heritage Laboratories
West Hartford, CT



More information about the R-help mailing list