Very little will break from openMx 1 to OpenMx 2, but most scripts from pre 2012 can beneficially be updated for OpenMz 2.x to gain new functionality.
An example is referenced here
The user had hassles with:
Solution 1: Include web urls rather than disk-based filepaths
so
source("http://www.vipbg.vcu.edu/~vipbg/Tc24/GenEpiHelperFunctions.R")
Solution 2: Use CRAN-based helpers, like umx and ezmx
Calls like this one are deprecated:
objMZ <- mxFIMLObjective( covariance="expCovMZ", means="expMean", dimnames=selVars)
It’s easy to update these across a stack of scripts, replacing “mxFIMLObjective” with “mxExpectationNormal” + a call to mxFitFunctionML()
In addition, in old-style multiple group algebra two-step calls like this:
minus2ll <- mxAlgebra( expression = MZ.objective + DZ.objective, name="m2LL") obj <- mxAlgebraObjective("m2LL")
You should replace "mxAlgebraObjective" with “mxFitFunctionAlgebra”
However, there is a nice Multigroup function which handles this in one line and enables identification checks, ref model generation etc.
So just replace the whole thing with:
mxFitFunctionMultigroup(c("MZ", "DZ"))}