[R] calculating mean and s.d. from a two-column table
jim at bitwrit.com.au
Tue Sep 28 09:42:14 CEST 2010
On 09/28/2010 02:34 AM, Jonas Josefsson wrote:
> I have a two-column table as follows where age is in the 1st column and
> the number of individuals is in the 2nd.
> Can I use mean() and sd() to calculate the mean and standard deviation
> from this or do I have to manually multiplicate 21*1+31*2 etc. / N?
You can also use weighted.mean:
More information about the R-help