Attachment | Size |
---|---|
discrepancy.R | 2.28 KB |
Hello fellow OpenMx-ers
In the interest of helping people transition to R, I have been converting the contents of an SEM seminar taught at our university from Mplus to OpenMx, also using lavaan for comparison. So I have a slightly complex path model with two exogenous variables, two mediating endogenous variables, and one outcome variable. The model produces the same fit indices and solutions (including estimates and SEs) in all three packages, and all but one standardized parameters are also identical. In particular, the modeled covariance between the residuals of the two endogenous (mediating) variables does NOT match, and I wonder if this is a bug somewhere or whether a different formula is used. Note that lavaan fully matches Mplus, it is only the standardized estimate in OpenMx that differs. In the demo data set used in the seminar the discrepancy is quite substantial (.68 vs. .30). I do not really know what this parameter should be divided by to be standardized, so I cannot check further myself. Code attached, using a dataset provided with lavaan, for easy checking; the problem is the same.
I reproduce the apparent discrepancy. Thank you for reporting it.
I'm running:
lavaan's default for
standardizedsolution()
uses a slightly different definition of what the "standardized" solution ought to be, compared to OpenMx. I can resolve the mismatch by passing argumentcov.std=FALSE
tostandardizedsolution()
.Great that you're helping people move to R! And great that Rob K got to the bottom of this in an hour or 2 and identified the choice in mplus/lavaan to use cov.std= TRUE.
Parenthetically, I made coded up the model using umxRAM as well, if you're assembling a transition guide.
Thank you both very much for resolving the discrepancy and for pointing me to umx!
I was wondering if a reverse treatment might be available, causing OpenMx to produce a standardized solution matching Mplus (rather than causing lavaan to match OpenMx). From a purely practical standpoint, this would be very useful because people here are used to Mplus (many years of experience, and a lot of complex models and high-profile publications), and may be unlikely to be positive toward a switch to something that produces different results.
Thanassi
You may also enjoy https://cran.r-project.org/web/packages/EasyMx/
Hi @Thanassi,
Why not comment on issue #159 at our github. That would also give people a place to add references for any benefits either way. A path from Mplus to OpenMx should be smooth, but this might not be a road block in practice?
I just added a comment, thank you for the suggestion.