One standardized value does not match Mplus/lavaan
Posted on
0avasns
Joined: 12/09/2010
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.
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
I'm running:
OpenMx version: 2.12.2 [GIT v2.12.2]
R version: R version 3.5.2 (2018-12-20)
Platform: x86_64-w64-mingw32
Default optimizer: CSOLNP
NPSOL-enabled?: Yes
OpenMP-enabled?: No
Log in or register to post comments
different formula
Log in or register to post comments
great this is solved (and another implementation for your guide)
Parenthetically, I made coded up the model using umxRAM as well, if you're assembling a transition guide.
# umx
library(umx); library(lavaan);
mVars <- c("x1","x2","t1","t2","t3")
uniRegMod = umxRAM("Demo", data = Demo.growth,
umxPath(v.m. = mVars),
umxPath(fromEach = c("x1","x2"), to = c("t1", "t2", "t3")),
umxPath(c("t1","t2"), to = "t3"),
umxPath("x1", with = "x2"),
umxPath("t1", with = "t2")
)
parameters(uniRegMod, patt = "t1_with_t2")
umxSummary(uniRegMod, show = "std")
Log in or register to post comments
Thank you + request
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
Log in or register to post comments
EasyMx too
Log in or register to post comments
post an issue at github
Why not comment on [issue #159 at our github](https://github.com/OpenMx/OpenMx/issues/159). 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?
Log in or register to post comments
In reply to post an issue at github by tbates
Done!
Log in or register to post comments