Is anybody knows how to model correlated residuals of some manifest variables in OpenMx? Can you give me any example of mxPath()
application to this issue?
Thank you very much! It seems to me, however, that the specified method reflects correlated manifest variables, not correlated error variance of manifests. Am I right?
see thread 1399 to see equivalence of manifest and residuals
HI Krzysiek,
This thread answers your question: It's an illuminating read about how identical functional specifications can nevertheless require different work for the optimiser
correlated residuals = mxPath(from = "var1", to = "var2")
This is easy in OpenMx: You just add paths between the variables you think have correlated residuals...
e.g., Here I add a correlation between x2 and x3 in the front-page example. it turns out to be a non-significant correlation:
require(OpenMx)data(demoOneFactor)
manifests <-names(demoOneFactor)
latents <-c("G")
m1 <- mxModel("One Factor", type="RAM",
manifestVars = manifests,
latentVars = latents,
mxPath(from = latents, to = manifests),
mxPath(from = manifests, arrows=2),
mxPath(from = latents, arrows=2, values =1),
mxData(cov(demoOneFactor), type ="cov", numObs =nrow(demoOneFactor)))
m1 = mxRun(m1)
m2 = mxRun(mxModel(m1, mxPath("x2", "x3", arrows=2, values=.01), name="correlated_X2_X3"))
mxCompare(m2, m1)
base comparison ep minus2LL dfAIC diffLL diffdf p
1 correlated_X2_X3 <NA>12-3649.8033-0.1389409 NA NA NA
2 correlated_X2_X3 One Factor 11-3648.2814-0.61599771.52294310.2171746
Here is something modified from the Home page
☺
Thank you very much! It seems to me, however, that the specified method reflects correlated manifest variables, not correlated error variance of manifests. Am I right?
Krzysiek
HI Krzysiek,
This thread answers your question: It's an illuminating read about how identical functional specifications can nevertheless require different work for the optimiser
http://openmx.psyc.virginia.edu/thread/1399
Thank you for explanation!
Krzysiek
This is easy in OpenMx: You just add paths between the variables you think have correlated residuals...
e.g., Here I add a correlation between x2 and x3 in the front-page example. it turns out to be a non-significant correlation: