I am using the mixed command to estimate a latent growth curve model with a cubic time trend (t, t^2, t^3). I would like to: (1) include random coefficients for the three terms, but also (2) use margins and marginsplot to plot the latent growth curve. Any suggestions on how I could do both?
I can create the square and cubic transformations manually (as in t2 = t*t), and estimate random coefficients:
However, margins will treat t - t3 as three unrelated variables.
If instead I use an interaction operator, margins will work properly but I can only include a random slope for the first time term:
Thanks for any suggestions.
I can create the square and cubic transformations manually (as in t2 = t*t), and estimate random coefficients:
Code:
mixed y t t2 t3 || id: t t2 t3 , cov(unstructured)
If instead I use an interaction operator, margins will work properly but I can only include a random slope for the first time term:
Code:
mixed y c.t c.t#c.t c.t#c.t#c.t || id: t , cov(unstructured)
Comment