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:*
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))
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 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. Some
4 matches
Mail list logo