Published on *OpenMx* (http://openmx.psyc.virginia.edu)

By *jflournoy*

Created *11/13/2013 - 23:33*

Wed, 11/13/2013 - 23:33 — jflournoy [1]

I would like to predict the slope and intercept from, say, gender in a very simple growth curve model. For the sake of this question, let's say it's the model described in the documentation here [2].

What would I add to include a time invariant predictor of the slope and intercept? In MPlus I would write `i on gender;`

and I would get an estimate of the path from gender to intercept. To do the same thing in openMX would I simply add that path specification? Would I need override any defaults so that I don't estimate a variance or mean path for this manifest variable?

For easy reference, below is the code for the simple growth curve.

require(OpenMx) growthCurveModel <- mxModel("Linear Growth Curve Model Path Specification", type="RAM", mxData( myLongitudinalData, type="raw" ), manifestVars=c("x1","x2","x3","x4","x5"), latentVars=c("intercept","slope"), # residual variances mxPath( from=c("x1","x2","x3","x4","x5"), arrows=2, free=TRUE, values = c(1, 1, 1, 1, 1), labels=c("residual","residual","residual","residual","residual") ), # latent variances and covariance mxPath( from=c("intercept","slope"), arrows=2, connect="unique.pairs", free=TRUE, values=c(1, 1, 1), labels=c("vari", "cov", "vars") ), # intercept loadings mxPath( from="intercept", to=c("x1","x2","x3","x4","x5"), arrows=1, free=FALSE, values=c(1, 1, 1, 1, 1) ), # slope loadings mxPath( from="slope", to=c("x1","x2","x3","x4","x5"), arrows=1, free=FALSE, values=c(0, 1, 2, 3, 4) ), # manifest means mxPath( from="one", to=c("x1", "x2", "x3", "x4", "x5"), arrows=1, free=FALSE, values=c(0, 0, 0, 0, 0) ), # latent means mxPath( from="one", to=c("intercept", "slope"), arrows=1, free=TRUE, values=c(1, 1), labels=c("meani", "means") ) ) # close model

**Links:**

[1] http://openmx.psyc.virginia.edu/users/jflournoy

[2] http://openmx.psyc.virginia.edu/docs/OpenMx/latest/TimeSeries_Path.html#latent-growth-curve-model

[3] http://openmx.psyc.virginia.edu/thread/3902

[4] http://openmx.psyc.virginia.edu/thread/2405

[5] http://openmx.psyc.virginia.edu/forums/opensem-forums/longitudinal-sem-and-latent-growth-curves