kinsim_internal: Simulate Biometrically informed Univariate Data

Description Usage Arguments Value

View source: R/helpers_simulation.R

Description

Generate paired univariate data, given ACE parameters.

Usage

1
2
3
4
5
6
7
8
9
kinsim_internal(
  r = c(1, 0.5),
  npg = 100,
  npergroup = rep(npg, length(r)),
  mu = 0,
  ace = c(1, 1, 1),
  r_vector = NULL,
  ...
)

Arguments

r

Levels of relatedness; default is MZ and DZ twins c(1,.5)

npg

Sample size per group; default is 100.

npergroup

List of sample sizes by group; default repeats npg for all groups.

mu

Mean for generated variable; default is 0.

ace

Vector of variance components, ordered by c(a, c, e); default is c(1,1,1).

r_vector

Alternative, give vector of relatedness coefficients for entire sample.

...

Optional pass on additional inputs.

Value

Returns data.frame with the following:

id

id

A1

genetic component for kin1

A2

genetic component for kin2

C1

shared-environmental component for kin1

C2

shared-environmental component for kin2

E1

non-shared-environmental component for kin1

E2

non-shared-environmental component for kin2

y1

generated variable for kin1 with mean of mu

y2

generated variable for kin2 with mean of mu

r

level of relatedness for the kin pair


discord documentation built on July 15, 2021, 9:06 a.m.