View source: R/helpers_simulation.R
kinsim_internal | R Documentation |
Generates paired univariate data for kinship pairs with specified genetic relatedness, following the classical ACE model (Additive genetic, Common environment, unique Environment).
kinsim_internal(
r = c(1, 0.5),
c_rel = 1,
npg = 100,
npergroup = rep(npg, length(r)),
mu = 0,
ace = c(1, 1, 1),
r_vector = NULL,
c_vector = NULL,
...
)
r |
Numeric vector. Levels of genetic relatedness for each group; default is c(1, 0.5) representing MZ and DZ twins respectively. |
npg |
Integer. Default sample size per group; default is 100. |
npergroup |
Numeric vector. List of sample sizes by group;
default repeats |
mu |
Numeric. Mean value for the generated variable; default is 0. |
ace |
Numeric vector. Variance components in order c(a, c, e) where a = additive genetic, c = shared environment, e = non-shared environment; default is c(1, 1, 1). |
r_vector |
Numeric vector. Alternative specification method providing relatedness coefficients for the entire sample; default is NULL. |
... |
Additional arguments passed to other methods. |
This function simulates data according to the ACE model, where phenotypic variance is decomposed into additive genetic (A), shared environmental (C), and non-shared environmental (E) components. It can generate data for multiple kinship groups with different levels of genetic relatedness (e.g., MZ twins, DZ twins, siblings).
A data frame with the following columns:
Unique identifier for each kinship pair
Genetic component for first member of pair
Genetic component for second member of pair
Shared-environmental component for first member of pair
Shared-environmental component for second member of pair
Non-shared-environmental component for first member of pair
Non-shared-environmental component for second member of pair
Generated phenotype for first member of pair with mean mu
Generated phenotype for second member of pair with mean mu
Level of genetic relatedness for the kinship pair
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.