[R] Problem with geeglm

Rick Bilonick rab45+ at pitt.edu
Sat Aug 26 00:41:34 CEST 2006


event.nab.2 is 0/1 and I dichotomized va to get va.2 to see if I could
get geeglm to work. glm has no problem with the data but geeglm chokes.
Each subject (patient.id) has at most 2 observations and more than 3/4
of the subjects have 2 observations. I have even worse problems trying
to use glmmPQL from MASS and worse still trying to use lmer from lme4.
But I figured a marginal model would work. (geeglm seems to work OK with
most of the explanatory factors in the data set I have but a couple of
them show similar problems.)

> summary(glm(event.nab.2~va.2,family=binomial(link="logit"),data=test))

Call:
glm(formula = event.nab.2 ~ va.2, family = binomial(link = "logit"),
    data = test)

Deviance Residuals:
    Min       1Q   Median       3Q      Max
-0.3787  -0.3787  -0.2246  -0.2246   2.7177

Coefficients:
              Estimate Std. Error z value Pr(>|z|)
(Intercept)    -2.5993     0.1804  -14.41  < 2e-16 ***
va.2(84, Inf]  -1.0685     0.3435   -3.11  0.00187 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for binomial family taken to be 1)

    Null deviance: 363.19  on 958  degrees of freedom
Residual deviance: 352.28  on 957  degrees of freedom
AIC: 356.28

Number of Fisher Scoring iterations: 6


summary(geeglm(event.nab.2~va.2,family=binomial(link="logit"),id=patient.id,cor="exch",data=test))
Error in geese.fit(xx, yy, id, offset, soffset, w, waves = waves,
zsca,  :
        nrow(zsca) and length(y) not match


> head(test)
  patient.id event.nab.2      va.2  
1          1           0 (-Inf,84]         
2          1           0 (-Inf,84]         
3          2           0 (84, Inf]         
4          2           0 (84, Inf]         
5          3           0 (84, Inf]         
6          3           0 (84, Inf]         

I'm using R 2.3.1 and the latest version of geepack. I get a similar
error message if I use va which is continuous.

I don't know what the error message from geeglm/geese means.

Rick B.



More information about the R-help mailing list