Fitting lmer() model help

Hi Karen,

I'm not an expert in your field, but I have a lot of experience fitting lmer models in ecology. From what you've described, I believe your models are correctly specified.

The warning messages you are getting suggest your models are not fitting correctly -- they indicate an issue with the design matrix (the matrix of IVs for each participant) in the model. Typically you will get these warnings when one or more columns in the design matrix are very nearly identical to a multiple of another column. Another name for this problem is collinearity. For example, if Trait_Anxiety and Anxiety1 are highly correlated, then you would get this warning.

One way to check is to look at the correlation matrix for your IVs. Packages corrplot and corrr will help.
Variance Inflation Factors (VIF) can be more sensitive to problems like this, check function car::vif()

Alternatively, you can start with a simpler model like

anxiety_model <- lmer(Anxiety2 ~ Intervention + (1|PPT), DATA)

and see if the warnings go away. If so, then add your other IVs back in one at a time and see when the warnings turn up again. If the warnings don't go away with that model, then there is some deeper issue with the data structure.

I know you probably can't post the actual data because of confidentiality reasons, but if you're still stuck after trying the above, you might try creating a dataset that has the same properties as yours but just has X1, X2, ... etc for IVs. I've never tried it, but package synthpop might help you here, and there are a few other strategies if you google "anonymize data r". If you center and scale all the IVs, and change their names, they should still cause you problems but the scale is meaningless unless you know the scaling constants, which you wouldn't share. Then you could share the anonymized data and it would be easier to diagnose more difficult issues.

Good luck!

1 Like