Confidence Intervals for Univariate Ordinal ACE Model with 2 Thresholds

I made sure to specify the mxCI for my standardized variance components call in my model and to put the "intervals=T" in my mxRun line. In my model fit $output$confidenceIntervals exists, but does not have any values.
Is this normal? If not, is there a way to create confidence intervals in the ordinal case? If it's just a silly code error, my code is below.
Any help would be appreciated!
univACEOrdModel <- mxModel("univACEOrd",
mxModel("ACE",
# Matrices a, c, and e to store a, c, and e path coefficients
mxMatrix( type="Full", nrow=nv, ncol=nv, free=TRUE, values=.6, label="a11", name="a" ),
mxMatrix( type="Full", nrow=nv, ncol=nv, free=TRUE, values=.6, label="c11", name="c" ),
mxMatrix( type="Full", nrow=nv, ncol=nv, free=TRUE, values=.6, label="e11", name="e" ),
# Matrices A, C, and E compute variance components
mxAlgebra( expression=a %*% t(a), name="A" ),
mxAlgebra( expression=c %*% t(c), name="C" ),
mxAlgebra( expression=e %*% t(e), name="E" ),
# Algebra to compute total variances and standard deviations (diagonal only)
mxAlgebra( expression=A+C+E, name="V" ),
mxMatrix( type="Iden", nrow=nv, ncol=nv, name="I"),
mxAlgebra( expression=solve(sqrt(I*V)), name="sd"),
mxAlgebra( expression=cbind(A/VP,C/VP,E/VP),name="stndVCs"),
# Calculate 95% CIs here
mxAlgebra(A+C+E,name="VP"),
##Yes, it's repetitive, but I was desperate and the above was exactly how it ran in my continuous univariate ACE model
mxCI(c("stndVCs")),
# Constraint on variance of ordinal variables
mxConstraint(V == I, name="Var1"),
# Matrix & Algebra for expected means vector
mxMatrix( type="Zero", nrow=1, ncol=nv, name="M" ),
mxAlgebra( expression= cbind(M,M), name="expMean" ),
mxMatrix( type="Full", nrow=2, ncol=nv, free=TRUE, values=c(0.8,1.2), label=c("thre1","thre2"), name="T" ),
mxAlgebra( expression= cbind(T,T), dimnames=list(c('th1','th2'),selVars), name="expThre" ),
# Algebra for expected variance/covariance matrix in MZ
mxAlgebra( expression= rbind ( cbind(A+C+E , A+C),
cbind(A+C , A+C+E)), name="expCovMZ" ),
# Algebra for expected variance/covariance matrix in DZ, note use of 0.5, converted to 1*1 matrix
mxAlgebra( expression= rbind ( cbind(A+C+E , 0.5%x%A+C),
cbind(0.5%x%A+C , A+C+E)), name="expCovDZ" )
),
mxModel("MZ",
mxData( observed=mzData, type="raw" ),
mxFIMLObjective( covariance="ACE.expCovMZ", means="ACE.expMean", dimnames=selVars, thresholds="ACE.expThre" )
),
mxModel("DZ",
mxData( observed=dzData, type="raw" ),
mxFIMLObjective( covariance="ACE.expCovDZ", means="ACE.expMean", dimnames=selVars, thresholds="ACE.expThre" )
),
mxAlgebra( expression=MZ.objective + DZ.objective, name="min2sumll" ),
mxAlgebraObjective("min2sumll")
)
univACEOrdFit <- mxRun(univACEOrdModel,intervals=T)
It was only recently in the
mxCI("ACE.stndVCs")
in the container model.Log in or register to post comments
In reply to It was only recently in the by mspiegel
Thanks so much for the quick
That's the problem with being lazy and adapting other people's scripts. I removed the unnecessary submodel and everything is working perfectly now.
Log in or register to post comments
Best to avoid T (and F)
It is better to spell out TRUE and FALSE as one day you will use a variable T (or F) and wonder why your previously working example stops working
Log in or register to post comments
In reply to Best to avoid T (and F) by mdewey
Along the same lines, you
will no longer work because mxEval() beleives that 'c' is a MxMatrix object, not the c() function in R.
Log in or register to post comments