[R-sig-ME] GEE and GLMM convergence issues
Arianna Cecchetti
arianna.cecchetti at uac.pt
Thu Dec 1 13:42:01 CET 2016
Dear all,
I am investigating differences of activity budget of dolphins across different temporal scales (i.e. years, months and and day time) and in relation to group size. I attach a subset of the data as example. I tried different approaches, but got convergence issues that I am struggling to deal with:
1) multinomial GEE (multgee package)
I first run an independence structure being this one faster. When I run the most complete models they fail the fitting and initial values are asked. So I provided some values with the bstart parameter including 3 and 4 initial values for the 3 and 4 predictors of the two models:
mod6 <- nomLORgee(ActivityState~GroupSize + GroupSize*as.factor(Year) + GroupSize*Month, data=test, id=NSequence, repeated=Rep, LORstr="independence", bstart=c(1,0,1))
mod7 <- nomLORgee(ActivityState~GroupSize + GroupSize*as.factor(Year) + GroupSize*Month + GroupSize*Day, data=test, id=NSequence, repeated=Rep, LORstr="independence", bstart=c(1,0,1,0))
but I get the following error message:
Error in nomLORgee(ActivityState ~ GroupSize + GroupSize * as.factor(Year) + :
'bstart' and 'beta' differ in length
I am wondering if I am providing the initial values in the correct way. When I try to run the same models with the time.exch structure even the most simple one including only one variable get stuck in a loop and won’t generate any output.
2) Four separated binomial GEE models for each activity state.
In one case values for estimates and standard errors doesn’t seem reliable.
geeglm(formula = ActivityState ~ GroupSize + as.factor(Year) + Month + Day + GroupSize * as.factor(Year) + GroupSize * Month + GroupSize * Day, family = binomial(link = "logit"), data = testsoc, id = NSequence, waves = Rep, corstr = "exch", scale.fix = T)
Coefficients:
Estimate Std.err Wald Pr(>|W|)
(Intercept) 5.84e+15 1.09e+16 0.29 0.5933
GroupSize -1.75e+15 5.55e+14 9.91 0.0016 **
as.factor(Year)2014 9.45e+15 1.60e+16 0.35 0.5533
as.factor(Month)August -3.62e+16 6.52e+15 30.93 2.7e-08 ***
as.factor(Month)July -3.53e+16 7.47e+15 22.36 2.3e-06 ***
as.factor(Month)June 1.78e+17 9.80e+16 3.31 0.0689 .
as.factor(Month)May -1.31e+15 1.32e+16 0.01 0.9207
as.factor(Month)September -1.29e+15 2.36e+16 0.00 0.9566
…..
Estimated Correlation Parameters:
Estimate Std.err
alpha 1.44e+15 2.43e+31
Number of clusters: 183 Maximum cluster size: 50
3) GLMM (package lme4, glmer function)
For the models which failed convergence I applied different optimizers, but some still report convergence failure although they provide an output (here is an example)
ActivityState ~ log(GroupSize) + (1 | NSequence) + as.factor(Year) + Month + Day + log(GroupSize) * as.factor(Year) + log(GroupSize) * Month + log(GroupSize) * Day
Data: testtrav
Control: glmerControl(optimizer = "bobyqa")
Scaled residuals:
Min 1Q Median 3Q Max
-2.565 -0.517 -0.150 0.552 5.757
Random effects:
Groups Name Variance Std.Dev.
NSequence (Intercept) 6.59 2.57
Number of obs: 2207, groups: NSequence, 183
Fixed effects:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -5.0105 3.5342 -1.42 0.15628
log(GroupSize) 0.8871 1.2095 0.73 0.46331
as.factor(Year)2014 1.4536 1.4187 1.02 0.30553
as.factor(Month)August 2.4192 3.6134 0.67 0.50317
as.factor(Month)July 1.5645 3.4415 0.45 0.64940
as.factor(Month)June 9.4559 4.2818 2.21 0.02722 *
…..
Correlation matrix not shown by default, as p = 20 > 12.
Use print(x, correlation=TRUE) or
vcov(x) if you need it
convergence code: 1
Model failed to converge with max|grad| = 0.00394719 (tol = 0.001, component 1)
Using max(abs(relgrad)) code all models failed to be reliable being the values well above 0.001.
So at this point I am a bit stuck in deciding which approach would be the best to deal with these convergence issues.
I greatly appreciate any suggestions at this regard.
Thank you!
Best,
Arianna
More information about the R-sig-mixed-models
mailing list