univ_multiv_ace_ade: Define univariate and multivariate ACE and ADE models

univ_multiv_ace_adeR Documentation

Define univariate and multivariate ACE and ADE models

Description

The functions define univariate and multivariate (correlated factors) ACE and ADE models.

Usage

univariate_ace(
  data,
  zyg = character(0),
  ph,
  data_type = "raw",
  sep = getOption("TwinAnalysis.sep")
)

univariate_ade(
  data,
  zyg = character(0),
  ph,
  data_type = "raw",
  sep = getOption("TwinAnalysis.sep")
)

multivariate_ace(
  data,
  zyg = character(0),
  ph,
  data_type = "raw",
  sep = getOption("TwinAnalysis.sep")
)

multivariate_ade(
  data,
  zyg = character(0),
  ph,
  data_type = "raw",
  sep = getOption("TwinAnalysis.sep")
)

Arguments

data

either data.frame (for raw data) or list (for covariance/correlation input). See Note.

zyg

name of the variable that labels zygosity in the data.frame.

ph

name of the phenotype, a single character value for univariate ACE/ADE or a character vector for multivariate ACE/ADE.

data_type

type of the data (raw, cov or cor). See Note.

sep

separator between the name of the phenotype and the label of a twin. Default is "" (empty string).

Value

One unfitted mxModel.

Note

The function accepts two forms of the data: data.frame (data_type = 'raw') or list of covariance/correlation matrices (data_type = 'cov', data_type = 'cor').

When data is a data.frame, zyg is expected to point at the variable in data that defines zygosity groups . Zygosity variable MUST be a factor with two labels: 'MZ' and 'DZ'.

When data is a list of covariance/correlation matrices, it must include two named elements, 'MZ' and 'DZ'. These elements must be the lists with following elements: observed (covariance/correlation matrix), means (numeric vector of observed means, optional) and numObs (number of observations).

By default, it is expected that phenotypic trait X is labeled as 'X1' in twin 1 and 'X2' in twin 2.

Output tables (univariate ACE/ADE): "Variance components": proportion of total variance explained by A/C/D/E; "Raw variance": total variance, variance of A/C/D/E.

Output tables (multivariate ACE/ADE): "Variance components": proportion of total variance explained by A/C/D/E, per phenotype; "Covariation components": total covariance, covariance of A/C/D/E, proportion of covariation explained by A/C/D/E; "All correlations": correlations for A/C/D/E and total (phenotypic) correlation; "A/C/D/E/Total correlations": correlation table for A/C/D/E or phenotypic correlation (not returned by get_output_tables).


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