h2_mzdz: ACE heritability estimation from MZ/DZ twin correlations

View source: R/h2_mzdz.R

h2_mzdzR Documentation

ACE heritability estimation from MZ/DZ twin correlations

Description

Estimates additive genetic (A), shared environmental (C), and unique environmental (E) variance components using Falconer's equations from monozygotic (MZ) and dizygotic (DZ) twin data.

Usage

h2_mzdz(
  mzDat = NULL,
  dzDat = NULL,
  rmz = NULL,
  rdz = NULL,
  nmz = NULL,
  ndz = NULL,
  selV = NULL,
  use = "complete.obs",
  ci = TRUE,
  bounds = FALSE,
  digits = 3
)

Arguments

mzDat

Optional data.frame containing MZ twin data.

dzDat

Optional data.frame containing DZ twin data.

rmz

Optional numeric scalar. Correlation for MZ twins.

rdz

Optional numeric scalar. Correlation for DZ twins.

nmz

Optional integer. Sample size for MZ twins.

ndz

Optional integer. Sample size for DZ twins.

selV

Character vector of length 2 specifying twin variables.

use

Correlation missing-data method passed to stats::cor(). Default is "complete.obs".

ci

Logical; if TRUE, returns approximate 95% confidence intervals.

bounds

Logical; if TRUE, constrain h2/c2/e2 estimates to [0,1].

digits

Integer controlling printed rounding.

Details

Falconer's estimators are:

h^2 = 2(r_{MZ} - r_{DZ}), c^2 = 2r_{DZ} - r_{MZ}, and e^2 = 1 - r_{MZ}.

Approximate variances are computed using

Var(r) \approx \frac{(1-r^2)^2}{n-1}

Given MZ/DZ data or their correlations and sample sizes, it obtains heritability and variance estimates under an ACE model as in \insertCitegidziela23;textualgap and \insertCitekeeping95;textualgap.

Value

A data.frame containing:

  • h2: additive genetic variance estimate.

  • c2: shared environmental variance estimate.

  • e2: unique environmental variance estimate.

  • vh2: estimated variance of h2.

  • vc2: estimated variance of c2.

  • ve2: estimated variance of e2.

  • se_h2: standard error of h2.

  • se_c2: standard error of c2.

  • se_e2: standard error of e2.

  • lcl_h2: lower 95% confidence limit for h2.

  • ucl_h2: upper 95% confidence limit for h2.

  • lcl_c2: lower 95% confidence limit for c2.

  • ucl_c2: upper 95% confidence limit for c2.

  • lcl_e2: lower 95% confidence limit for e2.

  • ucl_e2: upper 95% confidence limit for e2.

References

\insertRef

elks12gap

\insertAllCited

Examples

## Not run: 
h2_mzdz(rmz = 0.72,
        rdz = 0.33,
        nmz = 384,
        ndz = 243)
library(mvtnorm)
set.seed(12345)
selVars <- c("bmi1", "bmi2")
mzm <- as.data.frame(
  mvtnorm::rmvnorm(
    195,
    c(22.75, 22.75),
    matrix(2.66^2 * c(1, 0.67, 0.67, 1), 2)
  )
)
dzm <- as.data.frame(
  mvtnorm::rmvnorm(
    130,
    c(23.44, 23.44),
    matrix(2.75^2 * c(1, 0.32, 0.32, 1), 2)
  )
)
names(mzm) <- selVars
names(dzm) <- selVars
res <- ACE_CI(
  mzData = mzm,
  dzData = dzm,
  selV = selVars,
  n.boot = 50,
  seed = 123,
  verbose = FALSE
)
print(res)

## End(Not run)


gap documentation built on Oct. 27, 2026, 1:07 a.m.