Hi there, Perhaps
se<-function(x)sqrt(var(x,na.rm=T)/sum(!is.na(x))) object1<-as.data.frame.table(tapply(Data[Year=="1999"],list(Group[Year=="1999"],Season[Year=="1999"]),mean)) object2<-as.data.frame.table(tapply(Data[Year=="1999"],list(Group[Year=="1999"],Season[Year=="1999"]),se)) Hope this helps, Jorge On Tue, Apr 8, 2008 at 1:44 PM, LeCzar <[EMAIL PROTECTED]> wrote: > > Hey, > > I want to compute means and standard errors as two tables like this: > > se<-function(x)sqrt(var(x)/length(x)) > > > object1<-as.data.frame.table(tapply(Data[Year=="1999"],na.rm=T,list(Group[Year=="1999"],Season[Year=="1999"]),mean)) > > > object2<-as.data.frame.table(tapply(Data[Year=="1999"],na.rm=T,list(Group[Year=="1999"],Season[Year=="1999"]),se)) > > Part of the data is labeled as NA, therfore the na.rm=T. I succeed in > creating the table for the means, but not for the standard errors. The > message is "Error in FUN(X[[1L]], ...) : unused argument(s) (na.rm = > TRUE)". > Does anyone have an idea how to get the standard error computed? > > Thx! > > -- > View this message in context: > http://www.nabble.com/Problem-with-NA-data-when-computing-standard-error-tp16569057p16569057.html > Sent from the R help mailing list archive at Nabble.com. > > ______________________________________________ > R-help@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. > [[alternative HTML version deleted]] ______________________________________________ R-help@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.