General linear mixed model effect with error

Hi I've created this glmm with lme4, car package. After, trying many times I only get this two error. Please, can you help me to resolve this issue:

data_model$Diseased <- as.factor(data_model$Diseased)
data_model$Sex <- as.factor(data_model$Sex)
data_model <- na.omit(data_model)

full <- glmer(as.factor(Social_dist) ~ Sex  + Diseased + SVL + Body_Temp
               + (1 | date) + (1| ID) + (1 | Location), 
              data = data_model, family = binomial)

Warning message:
In checkConv(attr(opt, "derivs"), opt$par, ctrl = control$checkConv,  :
  Model is nearly unidentifiable: large eigenvalue ratio
 - Rescale variables?

Thank you so much

The warning message you received when fitting the generalized linear mixed model (GLMM) using the glmer() function in R indicates that your model is nearly unidentifiable. This means that the model has difficulty estimating the parameters due to the presence of multicollinearity, which occurs when two or more predictor variables are highly correlated.The warning message suggests that you should rescale your variables to address the issue. Rescaling variables can help improve the numerical stability of the model and make it easier to interpret the parameter estimates.Here are some steps you can take to address the warning message:

  1. Center and/or scale your continuous predictor variables: Subtract the mean and divide by the standard deviation for each continuous predictor variable. This can help reduce multicollinearity and improve the stability of the model.
    data_model$SVL <- scale(data_model$SVL)
    data_model$Body_Temp <- scale(data_model$Body_Temp)

  1. Check for multicollinearity: Use the vif() function from the car package to calculate the variance inflation factor (VIF) for each predictor variable. VIF values greater than 10 indicate high multicollinearity.
    vif(glm(Social_dist ~ Sex + Diseased + SVL + Body_Temp, data = data_model, family = binomial))

  1. Remove or combine highly correlated predictor variables: If you find that some predictor variables are highly correlated, consider removing one of them or combining them into a single variable.

After making these adjustments, refit your model using the glmer() function and check if the warning message persists. If the issue is still present, you may need to further investigate the structure of your data and the relationships between the predictor variables.

Thank you so much for your help, I will try your feedback

1 Like

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.