On 30/10/2008, at 9:08 AM, Juliet Hannah wrote:
I have included data at the bottom of this email. It can be read in by
highlighting the data and then using this command: dat <-
read.table("clipboard", header = TRUE,sep="\t")
I can obtain solutions with both of these:
library(gee)
fit.gee<-gee(score ~ chem + time, id=id,
family=gaussian,corstr="exchangeable",data=dat)
and
library(yags)
fit.yags <- yags(score ~ chem + time, id=id,
family=gaussian,corstr="exchangeable",data=dat,alphainit=0.05)
However, I am making a mistake with:
library(geepack)
fit.geese <- geese(score ~ chem + time, id=id,
family=gaussian,corstr="exch",data=dat)
I obtain the following error:
Error in geese.fit(x, y, id, offset, soffset, w, waves, zsca, zcor,
corp, :
nrow(zsca) and length(y) not match
Could someone tell me what I have done incorrectly. Thanks for your
time, Juliet.
I'm pretty sure this is a bug in geese(), which should be reported to
the
maintainer of geepack. The problem is with the treatment of missing
values.
If looks at dim(na.omit(dat[,c("id","score","chem","time")])) one
gets 44.
In geese.fit() zsca is set equal to matrix(1,N,1) where N is set
equal to
length(id). But id has length 46 whereas the response y has been
trimmed
down to length 44 by eliminating any rows of the data where any of
the variables
involved are missing. Hence a problem.
The solution of the problem requires some code re-writing by the
maintainer of geepack.
cheers,
Rolf Turner
######################################################################
Attention:\ This e-mail message is privileged and confid...{{dropped:9}}
______________________________________________
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.