Dear all,
I have unbalanced panel data with repeated sampling over 6 years, hence I am employing mixed linear regressions. I want to incorporate various covariates, which differ either at level 1 (observation level) or level 2 (individual level). I want to assess the effect of reading on cognitive test scores in later life. My level 1 predictors are, among others, age, wealthgroup, and the spread between observations due to the unbalanced nature. The level 1 predictors may change over time within each individual. Mylevel 2 predictors are constant for each individual and are education level and gender. My code for the mixed model with the random intercept is
I now also want to add random slopes. My first indication was to set the spread between observations as a random slope with:
Adding the spread as a random slope significantly improves the fit of my model. However, my question now is whether it is possible (and whether it makes sense) to add all level 1 predictors as random slopes. I have tried the following code, but even after an hour of computation time, no output was given
1. Is it possible to add multiple random slopes?
2. Does it make sense to add multiple slopes?
3. If I cannot/should not add multiple random slopes, how do I deal with the fact that my level 1 predictors vary over time?
Thanks all!
I have unbalanced panel data with repeated sampling over 6 years, hence I am employing mixed linear regressions. I want to incorporate various covariates, which differ either at level 1 (observation level) or level 2 (individual level). I want to assess the effect of reading on cognitive test scores in later life. My level 1 predictors are, among others, age, wealthgroup, and the spread between observations due to the unbalanced nature. The level 1 predictors may change over time within each individual. Mylevel 2 predictors are constant for each individual and are education level and gender. My code for the mixed model with the random intercept is
Code:
mixed testscore reading age wealthgroup spread education gender || mergeid_num:,
Code:
mixed testscore reading age wealthgroup spread education gender || mergeid_num: spread, covariance(unstructured)
Code:
mixed testscore reading age wealthgroup spread education gender || mergeid_num: spread age wealthgroup, covariance(unstructured)
2. Does it make sense to add multiple slopes?
3. If I cannot/should not add multiple random slopes, how do I deal with the fact that my level 1 predictors vary over time?
Thanks all!