I found a rather easy solution that circumvents this problem by:
1) creating your own length function using na.omit function
2) calculating variance using tapply
3) calculating length using new length function
4) calculating square root of variance by length
*Code from LeCzar:*
object1<-as.d
On Tue, Apr 8, 2008 at 12: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))
>
>
The missings are not your main problem.
The command var computes the variance-covariance matrix.
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
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=
4 matches
Mail list logo