[R] Statistics for the Grouped data

John Kane jrkrideau at yahoo.ca
Tue Nov 6 16:54:06 CET 2007


Hi Shubha,  

Have a look at the Hmisc package and try ?wtd.mean  as
the help command. This may be what you need.  Also you
might want to look at ?summerize in the Hmisc package.


--- Shubha Vishwanath Karanth
<shubhak at ambaresearch.com> wrote:

> Hi R,
> 
>  
> 
> I have the data,
> 
>  
> 
> Value
> 
> 0
> 
> 1
> 
> 2
> 
> 3
> 
> 4
> 
> 5
> 
> 6
> 
> Frequency:
> 
> 258
> 
> 125
> 
> 106
> 
> 94
> 
> 85
> 
> 12
> 
> 5
> 
>  
> 
> Say:
> 
> Value=c(0,1,2,3,4,5,6)
> 
> Frequency=c(258,125,106,94,85,12,5)
> 
>  
> 
>  
> 
> In R, how can I find the mean, variance, skewness
> and kurtosis for this
> grouped data? Is there a direct way of handling this
> type of grouped
> data, instead of writing the code for calculating
> these statistics?
> 
>  
> 
> Thanks for your help,
> 
> Shubha
> 
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained,
> reproducible code.
>



More information about the R-help mailing list