# Univariate Ordinal ACE question

1 post / 0 new Offline
Joined: 07/16/2020 - 18:34
Univariate Ordinal ACE question

Hello,

I am brand new to running univariate ordinal ACE models and am running into an error that I could use some help with.

Here is the code I am running:

# -----------------------------------------------------------------------

clu1SatModel <- mxModel("twinSat",
mxModel("MZ",
# Matrix & Algebra for expected means vector (SND), Thresholds and correlation
mxMatrix( type="Zero", nrow=1, ncol=nv, name="M" ),
mxAlgebra( expression= cbind(M,M), name="expMean" ),
mxMatrix(type="Full", nrow=1, ncol=ntv, free=TRUE, values=.4, name="expThreMZ", dimnames=list('th1',selVars) ),
mxMatrix(type="Stand", nrow=2, ncol=2, free=T, values=.2, lbound=-.99, ubound=.99, name="expCorMZ"),
mxData(mzData, type="raw"),
mxExpectationNormal( covariance="expCorMZ", means="expMean", dimnames=selVars, thresholds="expThreMZ" )),

mxModel("DZ",


# Matrix & Algebra for expected means vector (SND), Thresholds and correlation
mxMatrix( type="Zero", nrow=1, ncol=nv, name="M" ),
mxAlgebra( expression= cbind(M,M), name="expMean" ),
mxMatrix( type="Full", nrow=1, ncol=ntv, free=TRUE, values=.4, name="expThreDZ", dimnames=list('th1',selVars)),
mxMatrix(type="Stand", nrow=2, ncol=2, free=T, values=.2, lbound=-.99, ubound=.99, name="expCorDZ"),
mxData(dzData, type="raw"),
mxExpectationNormal( covariance="expCorDZ", means="expMean", dimnames=selVars, thresholds="expThreDZ" )),
mxAlgebra(MZ.objective + DZ.objective, name="2sumll" ),
mxFitFunctionML()

)
clu1SatFit <- mxRun(clu1SatModel)

The last line (clu1SatFit) returns the following error message:
Error: The references 'MZ.fitfunction' and 'DZ.fitfunction' are unknown in the algebra named 'twinSat.2sumll'