I am using linear mixed effects to look at how the variable Neuro (measured at baseline only) predicts change over time in the variable Score (measured at baseline, visit 2 and for some participants visit 3). I have decided to use participant Age as the measure of time. I have split the variable into two components:
AgeBetween - to account for variation between subjects: calculated as Mean Age within each subject. I have further centred AgeBetween by subtracting the overall mean at baseline - which gives me AgeBetweenCentred
AgeWithin: to account for variation within subjects: Age - Mean Age within each subject (comes out centred).
I am trying to estimate the following two models:
1. lmer(Score ~ AgeBetweenCentred + as.factor(site_id) + Neuro*Status*AgeWithin + Gender +
PremorbidID + as.factor(allele) + (1 | subject_label) , data = ., control =
lmerControl(optimizer ="Nelder_Mead")
2. lmer(Score ~ AgeBetweenCentred + as.factor(site_id) + Neuro*Status*AgeWithin + Gender +
PremorbidID + as.factor(allele) + (AgeWithin | subject_label) , data = ., control =
lmerControl(optimizer ="Nelder_Mead")
When I run the model with random slopes (model 2), it runs fine. When I don't use random slopes (1 | subject_label) I get the error that the Hessian matrix is degenerate with 1 negative eigenvalue - the model fails to converge. What could be the reason for this? I am surprised it does not converse when random slopes are not used.