You are here

age&sex as covariates; ordinal data

4 posts / 0 new
Last post
fishfis's picture
Offline
Joined: 06/26/2013 - 23:18
age&sex as covariates; ordinal data

This is the first time I use open Mx.
without such covariates, my script runs.

Now, I add age and sex as definition factors. results show :
'Unknown thresholds name 'expThreMZ1' detected in the objective function of model 'MZ'.

I don`t know what is wrong. So if you could give me some help? Thanks.

=================================================
MeanL

Inc Tmz ThreMZ

Tdz ThreDZ

CorMZ CorDZ

# Data objects for Multiple Groups
dataMZ dataDZ

#defination var
ageT1MZ ageT2MZ ageT1DZ ageT2DZ sexT1MZ sexT2MZ sexT1DZ sexT2DZ

Co # Algebra for making the means a function of the definition variables age and sex
DefMZ DefMZ1

DefDZ DefDZ1

objMZ objDZ

# Combine Groups
modelMZ modelDZ minus2ll obj Conf SatModel

# -------------------------------------------------------------------------------------------------------------------------------
# 1) RUN Saturated Model

SatFit

mhunter's picture
Offline
Joined: 07/31/2009 - 15:26
Include DefMZ1 in your model

I think the issue is that modelMZ does not have DefMZ1 in it, so there is nothing named "expThreMZ1" in the model. If you replace

modelMZ	<- mxModel( MeanL, Inc, Tmz, ThreMZ, CorMZ, dataMZ,objMZ, name="MZ" )

with something like

modelMZ	<- mxModel( MeanL, Inc, Tmz, ThreMZ, CorMZ, DefMZ, DefMZ1, dataMZ,objMZ, name="MZ" )

then should at least get a different error message, and it might even fix the issue. :)

You may need to add more objects into the model too, but hopefully this will get you started. The thing to remember is: declaring objects in R does NOT put them in your model.

fishfis's picture
Offline
Joined: 06/26/2013 - 23:18
thank you

Thank you. This problem is solved.
I add all the objects into the model. and there occurred another error:
'The following error occurred while evaluating the subexpression 'MZ.expThreMZ + MZ.beta %*% MZ.MZDefVars' during the evaluation of 'MZ.expThreMZ1' in model 'Sat'

Co # Algebra for making the means a function of the definition variables age and sex
DefMZ DefMZ1

DefDZ DefDZ1

# Objective objects for Multiple Groups
objMZ objDZ

# Combine Groups
modelMZ modelDZ minus2ll obj Conf SatModel SatFit

mhunter's picture
Offline
Joined: 07/31/2009 - 15:26
Non-conformable?

All of the error message did not copy over, so I don't know what error message you received. Guessing, I would think the error has something to do with non-conformable matrices. Am I right?

Log in or register to post comments