simulate_data: Simulate test data for mcLMM

Description Usage Arguments Value

View source: R/simulation.R

Description

Simulates response Y under the mcLMM model with the given parameters. Univariate LMM with 012 genotype value as covariate (sampled from binomial with 0.5 MAF)

Usage

1
simulate_data(ni, context.weights = NULL, var.e, var.g, random.seed = NULL)

Arguments

ni

Number of individuals

context.weights

Sampling rates for each context. Will append a 1 to these rates to ensure each sample has at least 1 context. Total number of contexts will be length(context.weights) + 1.

var.e

Residual variance

var.g

Within-individual residual variance + covariance

random.seed

Seed for reproducibility

Value

A list with slots X, K, and Y serving as input for EMMA R package (design matrix, kinship matrix, and response vector, respectively) and slots X.mc and Y.mc as input for the mcLMM functions. See mc_mle or mc_remle documentation for more details on mcLMM input.


brandonjew/mcLMM documentation built on Dec. 19, 2021, 11:42 a.m.