<div dir="ltr"><div dir="ltr">Hi,</div><div dir="ltr"><br></div><div dir="ltr">I am running a multilevel growth curve model to examine predictors of social anhedonia (SA) trajectory through ages 12, 15 and 18. SA is a continuous numeric variable. The age variable (Index1) has been coded as 0 for age 12, 1 for age 15 and 2 for age 18. I am currently using a time varying predictor, stress (LSI), which was measured at ages 12, 15 and 18, to examine whether trajectory/variation in LSI predicts difference in SA trajectory. LSI is a continuous numeric variable. The data has been converted to long format with SA in 1 column, LSI in the other, ID in another and age in another column. I used the code below to run my model using lmer. However, I get the following error. Please let me know how I can solve this error. Please note that I have 50% missing data in SA at age 12, which I am handling using the REML method.</div><div dir="ltr">modelLSI_maineff_RE <- lmer(SA ~ Index1* LSI+ (1 + Index1+LSI |ID),<br> data = LSIDATA, control = lmerControl(optimizer ="bobyqa"), REML=TRUE)<br>summary(modelLSI_maineff_RE)<br><pre aria-label="Console Output" role="document" id="m_7531240293147496572gmail-rstudio_console_output" style="font-family:"Lucida Console",monospace;font-size:13.3333px;outline:none;border:none;word-break:break-all;margin-top:0px;margin-bottom:0px;line-height:1.2;color:rgb(0,0,0)"><span role="document" style="outline:none"><span style="color:rgb(197,6,11)">Error: number of observations (=1080) <= number of random effects (=1479) for term (1 + Index1 + LSI | ID); the random-effects parameters and the residual variance (or scale parameter) are probably unidentifiable
</span></span></pre> I did test the within-person variance for the LSI variable and the within-person variance is significant. <br></div><div dir="ltr"><img src="cid:ii_lvsj7upx0" alt="image.png" width="542" height="164" class="gmail-CToWUd gmail-a6T" tabindex="0" style="cursor: pointer; outline: 0px;"><br></div><div dir="ltr"><br></div><div dir="ltr">Also, for some reason, the model runs if I specify the random effects as either of these 2 models. However, I want to know whether variation in LSI predicts variation in SA trajectory between and within people. Hence, I need both age and LSI in the random effects. <br> modelLSI1 <- lmer(SA ~ Index1* LSI+ (1 + Index1 |ID),<br> data = LSIDATA, control = lmerControl(optimizer ="bobyqa"), REML=TRUE)<br><b>OR</b><br> modelLSI2 <- lmer(SA ~ Index1* LSI+ (1 +LSI |ID),<br> data = LSIDATA, control = lmerControl(optimizer ="bobyqa"), REML=TRUE)<br><br><div>Please let me know how I can solve my error and examine the random effect of LSI. <br><div><div><br></div><div>Thank you,</div><div>Srinidhi</div></div></div></div></div>