sim_mpp_single_locus_partial: Simulate target (y) and mediator (m) for partial mediation...

View source: R/sim_mediation.R

sim_mpp_single_locus_partialR Documentation

Simulate target (y) and mediator (m) for partial mediation from a specified locus design matrix

Description

This function takes a locus design matrix, e.g., founder haplotypes dosages from CC mice, and simulates mediators and downstream outcomes or targets.

Usage

sim_mpp_single_locus_partial(
  locus_matrix,
  num_replicates,
  num_sim,
  qtl_a_effect_size = 0.1,
  m_b_effect_size = 0.5,
  qtl_c_effect_size = 0.1,
  beta_a = NULL,
  beta_c = NULL,
  M_ID_a = NULL,
  M_ID_c = NULL,
  num_alleles_a = 8,
  num_alleles_c = 8,
  m_strain_effect_size = 0,
  y_strain_effect_size = 0,
  sample_method = c("uniform", "crp"),
  num_founders = 8,
  impute = TRUE,
  sim_m_label = "sim_m",
  sim_y_label = "sim_y",
  return_means = TRUE
)

Arguments

locus_matrix

A design matrix of founder haplotypes at QTL for MPP founder strains. The number of rows should correspond to the number of strains. The number of columns is eight for the CC/DO.

num_replicates

DEFAULT: 1. The number of strain replicates to use.

num_sim

DEFAULT: 1. The number of simulated outcomes to produce.

qtl_a_effect_size

DEFAULT = 0.1. The proportion of variation in the simulated mediators explained by the QTL.

m_b_effect_size

DEFAULT = 0.5. The proportion of variation in the simulated outcomes explained by the mediator.

qtl_c_effect_size

DEFAULT = 0.1. The proportion of variation in the simulated outcomes explained by the direct effect of the QTL.

Examples

sim_mpp_single_locus_partial()

wesleycrouse/bmediatR documentation built on April 28, 2023, 4:01 p.m.