| h2_mzdz | R Documentation |
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.
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
)
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 |
digits |
Integer controlling printed rounding. |
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.
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.
elks12gap
\insertAllCited## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.