[R] call works with gee and yags, but not geepack
Rolf Turner
r.turner at auckland.ac.nz
Wed Oct 29 22:27:55 CET 2008
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}}
More information about the R-help
mailing list