Age effect on the ACE model?

Posted on
Picture of user. sunboy4554 Joined: 12/02/2013

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

Replied on Sun, 11/15/2015 - 12:39
Picture of user. AdminRobK Joined: 01/24/2014

In reply to by sunboy4554

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.

Replied on Mon, 11/16/2015 - 04:10
No user picture. Yuan Joined: 02/13/2015

In reply to by AdminRobK

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.

Replied on Mon, 11/16/2015 - 13:06
Picture of user. AdminRobK Joined: 01/24/2014

In reply to by Yuan

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)