Hi all,
I'm writing a simple latent change score demo using mxPath, and found something interesting. I believe we've talked about default means models before, but I don't recall.
In this model, two occasions of data (wisc1 and wisc6 below) are restated as the first occasion (wisc1) and a change or difference score (diff). As such, the second observation (wisc6) is fully explained, and has no intercept and no residual. By default, specifying 'type="RAM"' assigns freely estimated manifest means, so the code below actually has three means for two manifest variables. The easy thing is just to add an extra path function, specifying a fixed intercept of zero for wisc6. I'm asking a design question, however: should I have to override a default and tell OpenMx not to give wisc6 a mean?
x <- matrix(c(40.658, 50.686, 50.686, 108.014), nrow=2) y <- c(18.781, 47.341) <code> example <- mxModel("My Title", mxData(x, type="cov", means=y, numObs=204), type="RAM", manifestVars=c("wisc1", "wisc6"), latentVars="diff", mxPath(c("wisc1", "diff"), "wisc6", TRUE, 1, FALSE, 1, NA), mxPath(c("wisc1", "diff"), c("wisc1", "diff"), FALSE, 2, TRUE, 45, c("v_1", "v_d")), mxPath("wisc1", "diff", FALSE, 2, TRUE, 10, "cov_1d"), mxPath("one", c("wisc1", "diff"), FALSE, 1, TRUE, 1, c("mean1", "mean_diff")) )
My take is that yes, you should have to override a default. Having a means vector implies that you want to do something with the means. That you aren't is only a function of your particular model.
Two points:
-I have data, which implies I want to do something with it. There are no other default parameters included in OpenMx. Why should we assume a fully saturated means model and a complete lack of specification for the covariance model?
-I have a secondary issue with a default, unnamed parameter. It is a default that will in, virtually all cases, have to be overridden, either to remove the parameter or name it so I can more easily interpret and edit it. If an analyst thought "OpenMx does exactly what you tell it to," they might not notice the extra parameter. This could easily be an issue with categorical data models, where one may not want manifest means.
OK. I stand corrected.
In yesterday's developer's meeting we discussed your case. Here are the issues we took into consideration:
When a RAM model is created, we should not add any paths by default. Any path that is added should be added by a user. This should hold for the A matrix, the S matrix as well as for the M matrix.
There are three cases when a means model is required (i.e., in mxData there is an argument type="raw", or type="sscp", or means=) . All three cases should act exactly the same.
If a means model is required but not specified the user should be alerted. We should not build a means model in the background. This is consistent with the OpenMx philosophy that everything is "out front" and visible in a script. Thus, an error should be generated if a means model is required but not supplied.
So we decided to implement the following change:
Some minor comments to Steve's post. The changes he talked about will be in OpenMx 0.3.2, coming out 5/22-23/2010. Also, to reproduce the earlier behavior of OpenMx, you can use the following function: