Generation

generate functionTue, 18 Apr 2023

> model1 <- glmer(categorical_FOD_FODs ~ Condition_FODs + developmentaldisorder_FODs + Condition_FODs:developmentaldisorder_FODs + (1|subject_FODs), + data = indvar_FODs, + family = "binomial", + control = glmerControl(optimizer = "bobyqa")) what should I do if there is 'isSingular'? write me the code

model1_singular <- try(glmer(categorical_FOD_FODs ~ Condition_FODs + developmentaldisorder_FODs + Condition_FODs:developmentaldisorder_FODs + (1|subject_FODs), data = indvar_FODs, family = "binomial", control = glmerControl(optimizer = "bobyqa")), TRUE) if (class(model1_singular) == "try-error") { model1 <- glmer(categorical_FOD_FODs ~ Condition_FODs + developmentaldisorder_FODs + Condition_FODs:developmentaldisorder_FODs + (1|subject_FODs), data = indvar_FODs, family = "binomial", control = glmerControl(optimizer = "Nelder_Mead")) } else { model1 <- model1_singular }

Questions about programming?Chat with your personal AI assistant