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.
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
I believe I figured it out--one must specify the path for the predictor's variance and mean structure paths. In MPlus, I think that the default for regressing the latent slope and intercept on a predictor is to set the mean structure path to 0 and the variance path to 1. I'm not 100% sure about this, but this gave me basically an identical parameterization and estimation (I hope that's the correct way to say that). So, aside from adding my predictor, e.g., 'gender', to the manifest variables list, I also included this snippet: