Message/Author 


I want to estimate a model with repeated measures nested within patients nested within therapists, with a random slope for one of the crosslagged effects with variances both between patients and between therapists. The code below won’t work since the variance for the slope (S*) is on both within and between levels. Is it possible to also get an estimate for the random slope on the within level? %within% B_X BY X1@1 X2@1 X3@1; B_Y BY Y1@1 Y2@1 Y3@1; cX1 BY X1@1; cX2 BY X2@1; cX3 BY X3@1; cY1 BY Y1@1; cY2 BY Y2@1; cY3 BY Y3@1; X1Y3@0; [cX1cY3@0]; cX2 on cY1; cX3 on cY2; S  cY2 on cX1 (syx); S  cY3 on cX2 (syx); cX1 cY1 WITH B_X@0 B_Y@0; B_X with B_Y; S*; %between% X1Y3; [B_X* B_Y*]; [X1@0 X2* X3* Y1@0 Y2* Y3*]; S*; [S*]; Best, Fredrik Falkenström 


I see one problem in your statements S  cY2 on cX1 (syx); S  cY3 on cX2 (syx);  you cannot label a random slope expression because it does not refer to a single parameter. S has a mean, variance, and relationships with other variables. So the labels should appear where these aspects of S are referred to. I think it is probably easiest to do this as 3level instead of having time in wide format. So use 2 cluster variables: Therapist and Patient. Then the S variance is easily specified on the 2 Between levels with the bar statement on Within. The S* approach you use (see page 755 in the V8 UG) gives S variance on Within and Between but I am not sure how that turns out in this context. I don't know what error you got. 


Thanks! The parameter labels was a mistake, I included them in one of my runs because I wanted to ensure that the slope was estimated with equal loadings for both paths (cY2 on cX1 and cY3 on cX2), but perhaps that is always the case? Anyway, the problem was solved in the UG passage that you referred to, by stating S*  cY2 on cX1 and S*  cY3 on cX2. Unfortunately, the model did not converge using ML, and apparently it is not possible to get withinlevel slope variances with Bayesian estimation yet? 


Sorry for the double response here, but I forgot to mention that the 3level option probably won't work since I am controlling for the effect of the prior value of the outcome variable. The model I am using is Hamaker's Random Intercept CrossLagged Panel model, and I assume it is not possible to use in 3level format? 


Your twolevel approach with S*  ... should work in principle. I assume you have Cluster = therapist. The integration gets highdimensional due to random slopes for latent variables so maybe that's your stumbling block; check Tech8 for negative Abs changes (see our TEch8 FAQ). Also, I don't see that your model has autoregressions in it for your 2 DVs. You can send the output for your best effort to Support along with your license number. It would be nice to have this random slope extension of the RICLPM going. 


Thanks. I had to shorten the code to fit the constraint on message length, so the autoregressions apparently didn't make it into my post. I now get the following error message: THE ESTIMATED WITHIN COVARIANCE MATRIX COULD NOT BE INVERTED. COMPUTATION COULD NOT BE COMPLETED IN ITERATION 1. CHANGE YOUR MODEL AND/OR STARTING VALUES. The error persists with changed starting values and some changes to the model. I'll send my data and input file to the support. 

Back to top 