Generation

code to explanationThu, 20 Apr 2023

library(penalized) model1 <- glmer(categorical_FOD_FODs ~ 0 + Condition_FODs * Gender_FODs -1 + (1|subject_FODs), data = indvar_FODs, family = binomial, control = glmerControl(optimizer = 'bobyqa', optCtrl = list(method = 'nlminb', maxfun = 6000000)), penalty = L1(0.001)) # add L1 regularization with a small lambda value

This model is a linear mixed model with maximum likelihood estimation, here we use the glmer() function from the lme4 package to fit this model. We use the default setting of the glmer() function, here the optimizer is the L-BFGS-B algorithm. In addition, we set the maximum iteration number to be 6000000 to ensure the convergence of the model.

Questions about programming?Chat with your personal AI assistant