Age&Gender Covariates; Continuous data; Multivariate Analysis

1 reply [Last post]
luna.clara's picture
Offline
Joined: 12/23/2012

Hi all,

I would like to covariate for age & gender in a multivariate analysis. I found scripts to covariate but in ordinal data and in univarite analysis.

It would be really helpful for me it any of you could show me an example of a script on how to covariate (by age and gender) in a MV analysis, because I now from my previous univariate analysis that gender could be causing some genetic sex differences in 4 of the 6 traits that I’m using.

Thank you very much!!!

neale's picture
Offline
Joined: 07/31/2009
Univariate with age and sex

http://www.vipbg.vcu.edu/NIDAworkshop2012/twinACECovSexAge.R

Part of

http://www.vipbg.vcu.edu/NIDAworkshop2012

It's easy enough to make it multivariate for the Cholesky at least, increase the number of variables (nv) and make the matrices lower triangular:

pathA     <- mxMatrix( type="Lower", nrow=nv, ncol=nv, free=TRUE, 
                       values=.6, label="a11", name="a" ) 
pathC     <- mxMatrix( type="Lower", nrow=nv, ncol=nv, free=TRUE, 
                       values=.6, label="c11", name="c" )
pathE     <- mxMatrix( type="Lower", nrow=nv, ncol=nv, free=TRUE, 
                       values=.6, label="e11", name="e" )