-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Hey Dr. Singmann,
I really like afex. It has been helpful so far with getting overall tests for categorical variables with more than 2 levels except when I have a GLMM that I need to use more iterations on to get it to converge. For example, I usually run the following code on my GLMER objects that have trouble converging and may have to run it a second time (I have yet to need a third to reach convergence).
Savers <-glmer(Total.Aversive ~ c.conc*Sex*Condition*Environment
+ (c.conc|RatID), data=mydsuc, family=poisson)
# Model did not converge, used code below to extend # of iterations and start from where the previous model left off.
ss2 <- getME(Savers,c("theta","fixef"))
Savers <- update(Savers,start=ss2,control=glmerControl(optCtrl=list(maxfun=2e9)))
#Model did not converge again, Rerun above code for further iterations of the function picking up where the previous model left off and overwriting ss2 with updated variables.
ss2 <- getME(Savers,c("theta","fixef"))
Savers <- update(Savers,start=ss2,control=glmerControl(optCtrl=list(maxfun=2e9)))
summary(Savers)
No problem there. The model converges after the second iteration extension from where the last model left off. However, when I run afex::mixed to get the overall estimates for my GLMM effects with 3+ level categorical variables involved I run into problems with convergence that I cannot seem to correct.
I am running an LRT because I want to use REML due to its help with unequal cell sizes and not fully completed repeated measures by all subjects that are intrinsic to the paradigm I am working with. I have tried several things and this post would get very long if I explained fully. Briefly:
-
allFit did not work when used on the full.model even with all the optimizers and maxfun=2e09 or as an argument (allFit=TRUE) within the mixed function itself.
-
attempting an update as shown above on the mixedclassobjectname$full.model did not work
-
including the control=glmerControl(optCtrl=list(maxfun=2e9)) argument in the function within mixed also did not work.
Is there a way to start from where the previous models left off (theta & fixef) and extend the number of iterations of all the models run during the LRT and rerun the LRT with those updated? If so, do you have some example code? If not, do you have any suggestions? I am not a newbie but not a super advanced user in R. Any help is greatly appreciated here as I imagine others will encounter this issue.