get_cross_trait_cors | R Documentation |
Compute the phenotypic correlations across twins and across traits, for MZ and DZ twins. Can be used for any data on groups.
get_cross_trait_cors(dat, zyg, vars, compact = FALSE)
dat |
the data.frame with the variables zyg and paste(vars, rep(1:2, each = nv)) |
zyg |
the name of the zygosity variable (character string) |
vars |
the names of the variables to compute the descriptives for. If vars = c('X', 'Y', 'Z'), the function looks for c('X1', 'Y1', 'Z1', 'X2', 'Y2', 'Z2') |
compact |
return the MZ and DZ correlations in one table, MZ correlations on the upper triangle and DZ correlations on the lower triangle. Works only when the zygosity variable has exactly two levels |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.