# Age effect on the ACE model?

6 posts / 0 new
Offline
Joined: 12/02/2013 - 07:46
Age effect on the ACE model?

Hi everyone,

I am working on the ACE model. I want to evaluate the age effect on the ACE model. Additionally, I need to eliminate the age effect. How can I do this work. Many thanks.

Bo

Offline
Joined: 12/02/2013 - 07:46
Evaluate the rMZ and rDZ?

Hi,

I also want to know if the rMZ and rDZ can be calculated in openMX? Thank you.

Bo

Offline
Joined: 01/24/2014 - 12:15
Here's a simple twin-analysis

Here's a simple twin-analysis script that should help you get started. Notice that it includes the regression of the phenotype onto age as part of the model for the phenotypic mean. You'd get the MZ and DZ correlations by converting the estimated covariance matrices for MZ and DZ twins into correlation matrices.

Offline
Joined: 02/13/2015 - 14:46
Hi Robert, Your script also

Hi Robert,
Your script also works for me.
You mentioned "it includes the regression of the phenotype onto age as part of the model for the phenotypic mean". Did you refer to the following script? What does it mean? Do I need to delete the "cbind(b%%Age,b%%Age)"?

expMeanMZ <- mxAlgebra( expression= meanMZ + cbind(b%%Age,b%%Age), name="expMeanMZ" )
expMeanDZ <- mxAlgebra( expression= meanDZ + cbind(b%%Age,b%%Age), name="expMeanDZ" )

or

meanG <- mxMatrix( type="Full", nrow=1, ncol=ntv, free=TRUE, values=svMe, labels="xbmi", name="mean" )
expMean <- mxAlgebra( expression= mean + cbind(b%%Age,b%%Age), name="expMean" )

Additionally, how could I convert the covariance matrices into correlation matrices in OpenMx? Or it should be done by other softwares, such as Matlab?

Thank you.

Offline
Joined: 01/24/2014 - 12:15
The script I attached to my

The script I attached to my previous post is written for the case that both twins in a pair have the same age, which may or may not apply to your case.

This line creates an MxMatrix which will contain the age of the current twin pair, as taken from the raw dataset, when the OpenMx backend evaluates the likelihoods of each row of the dataset at runtime. The fact that the label begins with "data." makes age what is known as a "definition variable," because the model applied to each row (i.e., each twin pair) is conditionally defined based on the value of age in that row of the dataset:

defAge    <- mxMatrix( type="Full", nrow=1, ncol=1, free=FALSE, labels=c("data.age"), name="Age" )

This line is creating an MxMatrix that contains the regression coefficient for age:

pathB     <- mxMatrix( type="Full", nrow=1, ncol=1, free=TRUE, values= .01, label="b11", name="b" )

This line is creating an MxMatrix that contains the regression intercept:

meanG <- mxMatrix( type="Full", nrow=1, ncol=ntv, free=TRUE, values=svMe, labels="xbmi", name="mean" )

This line is creating an MxAlgebra that will evaluate to a vector with two elements, each of which equals the regression intercept plus the effect of age. Thus, the model-expected phenotypic mean for each twin pair is conditionally defined by age.

expMeanDZ <- mxAlgebra( expression= meanDZ + cbind(b%*%Age,b%*%Age), name="expMeanDZ" )

To get the twin correlations, you could add an MxAlgebra to your model that converts the covariance matrix to a correlation matrix, e.g.

expCorMZ <- mxAlgebra(cov2cor(expCovMZ),name="expCorMZ")
expCorDZ <- mxAlgebra(cov2cor(expCovDZ),name="expCorDZ")

Or, you could apply the conversion from the R prompt after running your model, e.g.

mxEval(cov2cor(expCovMZ), AdeFit\$MZ, TRUE)
Offline
Joined: 07/31/2009 - 15:14
Workshop?

Hi Bo

It seems that a workshop on methods for twin research might be a good thing for you to attend. There will be one in Boulder, CO March 7-11 2016.

Log in or register to post comments