Hi! guys,

I am doing the threshold model for ordinal variables. and I finished the variables for 3 levels. However, I need modify the script to another variable which contain more 5 levels. I sucess with saturated model wiithout increments It gives me 18 parameters : rMZ,rDZ,4 threshold for MZ1 4 threshold for MZ2,4 threshold for DZ1 and 4 threshold for DZ2,respectively. But I was stuck at ADE model. Some problems in increments.

My script like this:

# Set Starting Values

thVals corValsM corValsD

# SATURATED MODEL:

# Matrices for expected Means & Thresholds (on liabilities) in MZ & DZ twin pairs

MeanG
meanG
threMZ
threDZ
corMZ
corDZ

# Data objects for Multiple Groups

dataMZ
dataDZ

# Objective objects for Multiple Groups

objMZ
objDZ

# Combine Groups

groupMZ
groupDZ
minus2ll
obj
ciCor
ciThre
twinSatModel

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

# RUN SATURATED MODEL (Tetrachoric correlations)

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

twinSatFit
twinSatSumm
round(twinSatFit@output$estimate,4)

twinSatSumm

###It works.

####FOR ACEmodel:

athA
pathC
pathE

# Matrices generated to hold A, C, and E computed Variance Components

covA
covC
covE

# Matrix & Algebra for expected means vector and expected thresholds

mean Inc

thresh
values=c(-0.226,0.127,0.736,1.892),

lbound=c(-3,.001),

labels=c("t1","inc21","inc32","inc43"),

name="Thre")

threshold

# Algebra to compute total variances and standard deviations (diagonal only)

covP

# Algebras generated to hold Parameter Estimates and Derived Variance Components

rowVars colVars estVars

# Algebra for expected Mean and Variance/Covariance Matrices in MZ & DZ twins

covMZ
cbind(A+C , A+C+E)), name="expCovMZ" )

covDZ
cbind(0.5%x%A+C , A+C+E)), name="expCovDZ" )

# Constraint on variance of Binary variables

matUnv var1

# Data objects for Multiple Groups

dataMZ
dataDZ

# Objective objects for Multiple Groups

objMZ
objDZ

# Combine Groups

pars
modelMZ
modelDZ
minus2ll
obj
AceModel

tableFitStatistics(twinSatFit,aceFitConst)

###it only gives me 5 parameters in ACE model: a11, c11,e11, t1, inc.

I think there must be some thing wrong with Increment.

Does anyone have some good idea about how to fix it? Thank you so much for that!