# geepack: parameter estimates change sign depending on correlation structure

I'm working on a dataset with the following variables:

Y:  a boolean telling whether the subject has experienced a seizure
ID:  the id of the subject
Sess:  the subject's session number (a subject has been observed multiple times)
X3:  numeric measurements of the subject's behavior during the session
X4:  "
X6:  "


The idea is to see if the behavior measurements(X3,X4,X6) can be used predict the Seizure status (Y) in the population. If there were just one session per subject I'd model the data with a logistic regression, but since each subject has multiple sessions the observations cannot be assumed independent.

It seems a GEE logistic model makes the most sense for this dataset, but I'm having trouble understanding the results when compared to a regular glm. When introducing correlation structure to the GEE equation the signs of the coefficients are reversed, and the predicted values are opposite of what they would be with an independent correlation structure.

library("geepack")
#regular logistic model
mod0 = glm(Y~X3+X4+X6, family=binomial("logit"), data=mice)
#gee logistic model, independent correlation structure
mod1 = geeglm(Y~X3+X4+X6, id=ID, family=binomial("logit"), corstr="indep", scale.fix=T, waves=Sess, data=mice)
#gee logistic model, exchangeable correlation structure
mod2 = geeglm(Y~X3+X4+X6, id=ID, family=binomial("logit"), corstr="exchangeable", scale.fix=T, waves=Sess, data=mice)


As expected, the parameter estimates of the glm model(mod0) and the independent correlation gee model(mod1) are the same. But when an exchangeable correlation structure(mod2) is introduced, the estimates are completely different and change sign.

>
> summary(mod1)

Call:
geeglm(formula = Y ~ X3 + X4 + X6, family = binomial("logit"),
data = mice, id = ID, waves = Sess, corstr = "indep", scale.fix = T)

Coefficients:
Estimate Std.err  Wald Pr(>|W|)
(Intercept)   -1.494   0.459 10.59  0.00114 **
X3            -2.377   0.626 14.42  0.00015 ***
X4             1.090   0.398  7.50  0.00619 **
X6             1.233   0.403  9.36  0.00222 **
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Scale is fixed.

Correlation: Structure = independenceNumber of clusters:   28   Maximum cluster size: 4
> summary(mod2)

Call:
geeglm(formula = Y ~ X3 + X4 + X6, family = binomial("logit"),
data = mice, id = ID, waves = Sess, corstr = "exchangeable",
scale.fix = T)

Coefficients:
Estimate Std.err Wald Pr(>|W|)
(Intercept)  -0.8928  0.4255 4.40   0.0359 *
X3            0.1059  0.0383 7.64   0.0057 **
X4           -0.0427  0.0299 2.04   0.1535
X6           -0.0528  0.0213 6.16   0.0131 *
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Scale is fixed.

Correlation: Structure = exchangeable  Link = identity

Estimated Correlation Parameters:
Estimate Std.err
alpha     1.09   0.133
Number of clusters:   28   Maximum cluster size: 4


My biggest concern is that the predicted Y's of the two GEE models show opposite trends, i.e. behaviors that would predict a positive seizure status in mod1, predict a negative seizure status in mod2.

plot(mod1$fitted, mod2$fitted)


Also, what's with the estimated correlation parameter of alpha = 1.09 in mod2? Unless I'm interpreting this wrong, shouldn't this always fall between -1 and 1?

Correlation: Structure = exchangeable  Link = identity

Estimated Correlation Parameters:
Estimate Std.err
alpha     1.09   0.133


It seems odd to me that the results are completely flipped depending on whether or not the observations are assumed to have dependence structure. Can anyone else offer insight on this behavior?

Here is the data:

> dput(mice)
structure(list(Y = c(0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 0L, 0L, 1L, 1L, 1L, 1L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 1L, 1L, 0L,
0L, 0L, 1L, 1L, 1L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 0L,
0L, 0L, 0L, 0L, 1L, 1L, 1L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L
), ID = c(1L, 1L, 1L, 2L, 2L, 2L, 3L, 3L, 3L, 4L, 4L, 4L, 5L,
5L, 5L, 6L, 6L, 6L, 7L, 7L, 8L, 8L, 9L, 9L, 10L, 10L, 11L, 11L,
11L, 12L, 12L, 12L, 13L, 13L, 13L, 13L, 14L, 14L, 14L, 14L, 15L,
15L, 15L, 15L, 16L, 16L, 16L, 16L, 17L, 17L, 17L, 18L, 18L, 18L,
19L, 19L, 19L, 20L, 20L, 20L, 21L, 21L, 21L, 22L, 22L, 22L, 23L,
23L, 23L, 23L, 24L, 24L, 24L, 24L, 25L, 25L, 25L, 25L, 26L, 26L,
26L, 26L, 27L, 27L, 27L, 27L, 28L, 28L, 28L, 28L), Sess = c(2L,
3L, 4L, 2L, 3L, 4L, 2L, 3L, 4L, 2L, 3L, 4L, 2L, 3L, 4L, 2L, 3L,
4L, 3L, 4L, 3L, 4L, 3L, 4L, 3L, 4L, 1L, 3L, 4L, 1L, 3L, 4L, 1L,
2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 2L,
3L, 4L, 2L, 3L, 4L, 2L, 3L, 4L, 2L, 3L, 4L, 1L, 2L, 3L, 1L, 2L,
3L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L,
4L, 1L, 2L, 3L, 4L, 1L, 2L, 3L, 4L), X3 = c(0.511015060794264,
0.898356533693696, 0.798280430157052, 1.31144372617517, 0.829923189452201,
0.289089506643144, -0.763028944257538, -0.944459588217789, -1.16474609928919,
-0.182524267014845, -0.338967193889711, -0.896037509887988, 0.00426073081308205,
0.0576592603165749, -1.4984737260339, 1.34752684212464, 0.106461438449047,
-0.108424579472268, -2.85991432039569, -0.230115838261355, -1.54479536845993,
-1.23693649938367, -1.53704616612456, -1.04825100254239, 0.142768659484482,
0.28358135516745, -0.236302896321009, 0.708743856986942, -0.507503006972081,
0.401550711842527, -0.16928449007327, 0.867816722958898, 0.487459858572122,
1.35172112260613, 0.14742652989871, 0.742155288774287, 0.348552056119878,
-0.82489952485408, 0.0366834636917457, -0.731010479377091, 0.979544093857171,
1.4161996712129, 0.661035838980077, 0.600235250313596, -1.10872641912335,
-0.212101744145196, -0.919575135240643, -0.813993077336991, -0.547068540188791,
-0.0260198210967738, -0.0962240349391501, -0.251025721625606,
0.894913664382802, -0.21993004239326, 0.0628839847717805, 1.77763503559622,
0.718459471596243, 0.984412886705251, 0.77603470471174, 0.486187732642953,
1.78012655684609, 1.31622243756713, 1.29635178661133, 0.427995111986702,
0.993748401511881, 0.387623239882247, 0.42006794384777, -0.815889182132972,
-0.897540332229183, -1.041943103505, 0.379425827374942, -1.00707718576756,
-0.889182530787803, 0.148432805676879, -0.287928359114935, -0.747152636892815,
-1.41003790431546, -0.611571256991109, -1.02569548477235, -1.02700056733181,
-1.45808867127733, -1.47973458605138, 2.23643966561508, 2.69397876103083,
0.81841473415516, 2.12167589051282, 0.267133799544379, -0.326215175076418,
-1.08788244901967, -1.18733017947214), X4 = c(0.050598970482242,
-0.0279694583060402, 0.999225143631274, 0.199872317584803, 0.779316284168575,
-0.3552692229881, -0.232161792808608, -0.333479851296274, -0.748169603107953,
-0.57785843363913, -0.480747933235349, -0.740466500603612, -0.618559437949564,
-0.591541699294345, -0.538855647639331, 0.431376763414175, -0.327931008191724,
-0.469416282917978, -0.659224551441466, -0.55285236403596, -0.637082867133913,
-0.780321541069982, -0.40539035027884, -0.54024676972473, -0.185562290173831,
0.054439450703482, 0.624097793456316, 0.24018937319873, -0.264194638773171,
-0.389590537012038, -0.42771343162755, -0.738790918078674, -0.122411831542788,
0.600119921164627, 0.0442597161778152, -0.0955011351192086, -0.521259643827527,
-0.550050365103255, -0.504566887441653, -0.506571005423286, 0.523650149759566,
0.341920916685254, -0.396343801985993, -0.366532239883921, -0.739276449002057,
-0.56054127343218, -0.587601788901296, -0.56798329186843, -0.454937006653748,
-0.672730639942183, -0.564864467446687, -0.678853515419629, 0.573072971483937,
0.596973680548765, 0.0403978228634349, 1.93617633381248, 2.54301964691615,
0.363075891004736, 0.0205658396444095, 0.560923287570261, 1.24212005971229,
2.32518793880728, 2.69979166871713, 0.626868716830008, 0.219463581391793,
0.236477261174534, -0.115429539698909, -0.49754151674106, -0.40827433350644,
-0.0433283703798658, -0.578451015506926, -0.714208713291922,
-0.802387726290423, -0.836794085697031, -0.471800405613954, -0.668030208971065,
-0.610945789491312, -0.780838257914176, -0.411360572155088, -0.494388869332376,
-0.63231547268951, -0.743853022088574, 4.90627675753856, 3.38455016460328,
0.859445571488139, 2.42212262705776, -0.324759764820016, -0.541581784452693,
-0.485324968098865, -0.770539730529603), X6 = c(0.0150287583709043,
-0.151984283645294, -0.347950002037732, 0.379891135882966, 0.129107019894704,
-0.314047917638528, -0.516381047940779, -0.751192211830495, -0.884460389494645,
-0.462363867892961, -0.397583161539858, -0.559528880497725, -0.842987555132397,
-0.922797893301111, -1.01175722882932, 0.32346425626624, -0.610909601293237,
-0.605155952259822, -1.29840867980623, 0.0793710626694382, -0.806959976634144,
-0.674523251142452, -0.960113466801064, -0.783836535852452, -0.0665321645536412,
0.482235339656537, -0.319499220427413, -0.115345965733089, -0.30806448545927,
0.251747727063608, -0.305013811851957, -0.931916656036151, 0.415032839884745,
0.337184728843034, 0.0584335852357015, -0.0712185313438638, 0.78632612201797,
0.490831043388539, 0.8902425262631, 0.160088439571744, 0.90343086944952,
0.928495373121098, -0.389259569427933, -0.304578433259833, -0.593364448723133,
-0.411333868741105, -0.882691663964141, -0.91208274239495, -0.708633954450382,
-0.339396626779965, -0.420927315080057, -0.421383857909298, 0.407474183771483,
0.629710767351175, -0.438726438495567, 2.40977730548689, 2.47250810430208,
0.783562677342961, 0.781304150896319, 0.563221804716475, 1.85514126067038,
1.30723846671955, 1.94869625911545, 0.876751836832149, 0.626629859119409,
0.067113945916172, 3.54280776301513, 0.0082773667305384, -0.311414481848668,
-0.732779325538588, -0.594477082903005, -1.0385239418576, -1.04141739541776,
-0.99472304141247, -0.599659297534257, -0.804801224448196, -1.13096932958525,
-0.641957537144073, -0.722959119516237, -0.671146043591047, -0.714432955420477,
-0.766750949574034, 1.20993739830475, 2.79011376379402, 2.64532317075082,
2.54251033029822, -0.539516582572252, -0.6419726544563, -0.663768795224503,
-0.644829826467113)), .Names = c("Y", "ID", "Sess", "X3", "X4",
"X6"), row.names = c(NA, -90L), class = "data.frame")