Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Getting the standard error of the mean involves two steps: first get the standard deviation and count for each group, then use those values to calculate the standard error. The standard error for each group is just the standard deviation divided by the square root of the sample size:
library(MASS)# For the data setlibrary(plyr)ca<-ddply(cabbages,c("Cult","Date"),summarise,Weight=mean(HeadWt,na.rm=TRUE),sd=sd(HeadWt,na.rm=TRUE),n=sum(!is.na(HeadWt)),se=sd/sqrt(n))caCult Date Weight sd n se c39 d163.180.9566144100.30250803c39 d202.800.2788867100.08819171c39 d212.740.9834181100.31098410c52 d162.260.4452215100.14079141c52 d203.110.7908505100.25008887c52 d211.470.2110819100.06674995