## Definition variables: How to make variance estimates a function of definition variables?

2 replies [Last post]
Offline
Joined: 11/30/2009

How does one make the variance estimates a function of the definition variable sex? I am working on a univariate script with two groups, MZ and DZ, with opposite sex twins included in the DZ group. I have tried to apply principles from the moderator script from Boulder, but I'm not sure if that is OK for the definition variable case. The script below fails due to inconformable arrays, and I am working on getting the matrices in the right format, but I need to know whether I am on the right track here. Very grateful for any help to get some steps further.

mxModel("DZ", mxData( observed=dzData, type="raw" ),
# Matrix for definition variable
mxMatrix( type="Full", nrow=2, ncol=1, free=F, label=c("data.ASEX","data.ASEX"), name="DZDefVars"),
# Algebra for making the means a function of the definition variable sex
# Algebra for making the variance estimates a function of the definition variable sex
# Algebra for expected variance/covariance matrix and expected mean vector in DZ
.

Offline
Joined: 08/04/2009
Hi the issue is that your

Hi
the issue is that your DZDefVars variable contains the sex of both twins - which is what you want for your means correction. but for the variance correction you need to consider the sex of each twin individually.
try something like this (this is a traditional sex-limitation approach to the problem - there are more elegant ways to set up these types of models but this is more explicit)

mxMatrix( type="Full", nrow=1, ncol=1, free=F, label=c("data.ASEX"), name="sex1"),
mxMatrix( type="Full", nrow=1, ncol=1, free=F, label=c("data.BSEX"), name="sex2"),