Hi everyone!
Sorry to ask another question again. I'd like to analyse the trait correlation, for example BMI and WC, which function should I try to use or is there any scripts which I can study. Thanks a lot.
Do you just mean the ordinary Pearson correlation between two phenotypes? That's pretty easy. Really, any model that fits a "saturated" covariance matrix can give you the correlation, because you can convert a covariance matrix to a correlation matrix with cov2cor(). Your best bet will be to analyze the raw data, because of the way full-information maximum-likelihood deals with missing data. As an example, you could search this website for BivariateSaturated_MatrixRawCholesky.R .
If this is in the context of a twin model, you could just apply cov2cor to whatever the model's expected covariance matrix works out to be, and look at the within-person, cross-trait correlation.
Do you just mean the ordinary Pearson correlation between two phenotypes? That's pretty easy. Really, any model that fits a "saturated" covariance matrix can give you the correlation, because you can convert a covariance matrix to a correlation matrix with
cov2cor()
. Your best bet will be to analyze the raw data, because of the way full-information maximum-likelihood deals with missing data. As an example, you could search this website for BivariateSaturated_MatrixRawCholesky.R .If this is in the context of a twin model, you could just apply
cov2cor
to whatever the model's expected covariance matrix works out to be, and look at the within-person, cross-trait correlation.