[R] Problem with NA data when computing standard error

LeCzar sirnixu at gmail.com
Tue Apr 8 19:44:14 CEST 2008


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.



More information about the R-help mailing list