Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mixed command with random, non-linear time trend and marginsplot

    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:

    Code:
    mixed y t t2 t3 || id: t t2 t3 , cov(unstructured)
    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:

    Code:
    mixed y c.t c.t#c.t c.t#c.t#c.t || id: t , cov(unstructured)
    Thanks for any suggestions.

  • #2
    If you're interested mainly in the fixed effects in margins, can you use a hybrid?
    Code:
    mixed y c.t##c.t##c.t || id: t t2 t3, covariance(unstructured)

    Comment


    • #3
      Thank you, Joseph! This should solve the problem

      Comment

      Working...
      X