cross_trait_cors: Compute the cross-twin cross-trait correlations

get_cross_trait_corsR Documentation

Compute the cross-twin cross-trait correlations

Description

Compute the phenotypic correlations across twins and across traits, for MZ and DZ twins. Can be used for any data on groups.

Usage

get_cross_trait_cors(dat, zyg, vars, compact = FALSE)

Arguments

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


IvanVoronin/TwinAnalysis documentation built on July 24, 2024, 9:36 p.m.