An example is referenced here.
The user had hassles with:
1. No path to the genepihelper functions
Solution 1: Include web urls rather than disk-based filepaths
source("http://www.vipbg.vcu.edu/~vipbg/Tc24/GenEpiHelperFunctions.R")
Solution 2: Use CRAN-based helpers, like umx and ezmx
2. Old-style objectives (instead of expectations and fit functions)
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" and 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"))}