You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If there are only two observations per cluster, and an unsturctured correlation structured is used, genZcor and consequently geeglm fail with a relatively unhelpful message.
gendat<-function() {
id<- gl(5, 4, 20)
visit<- rep(1:4, 5)
y<- rnorm(id)
dat<-data.frame(y, id, visit)[c(-2,-9),]
}
set.seed(88)
dat<- gendat()
dat2<- subset(dat, visit%in%1:2)
zcor<-geepack::genZcor(clusz= table(dat$id), waves=dat$visit, corstrv=4)
zcor<-geepack::genZcor(clusz= table(dat2$id), waves=dat2$visit, corstrv=4)
#> Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]): contrasts can be applied only to factors with 2 or more levels
Hello
If there are only two observations per cluster, and an unsturctured correlation structured is used,
genZcor
and consequentlygeeglm
fail with a relatively unhelpful message.Created on 2023-03-27 with reprex v2.0.2
This appears to be caused by the line
ans <- model.matrix(~z - 1)
ingenZcor
, wherez
is a factor variable with only one level (1:2).Can this be made to work, or a helpful error message added explaining the problem?
Thanks very much for your work on this package :)
The text was updated successfully, but these errors were encountered: