Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

umx_make_MR_data

Simulate Mendelian Randomization data


Description

umx_make_MR_data returns a dataset containing 4 variables: A variable of interest (Y), a putative cause (X), a qtl (quantitative trait locus) influencing X, and a confounding variable (U) affecting both X and Y.

Usage

umx_make_MR_data(
  nSubjects = 1000,
  Vqtl = 0.02,
  bXY = 0.1,
  bUX = 0.5,
  bUY = 0.5,
  pQTL = 0.5,
  seed = 123
)

Arguments

nSubjects

Number of subjects in sample

Vqtl

Variance of QTL affecting causal variable X (Default 0.02)

bXY

Causal effect of X on Y (Default 0.1)

bUX

Confounding effect of confounder 'U' on X (Default 0.5)

bUY

Confounding effect of confounder 'U' on Y (Default 0.5)

pQTL

Decreaser allele frequency (Default 0.5)

seed

value for the random number generator (Default 123)

Details

The code to make these Data. Modified from Dave Evans 2016 Boulder workshop talk.

Value

- data.frame

See Also

umx_make_TwinData

Examples

df = umx_make_MR_data(10000)
str(df)
## Not run: 
m1 = umxTwoStage(Y ~ X, ~qtl, data = df)
plot(m1)

## End(Not run)

umx

Structural Equation Modeling and Twin Modeling in R

v4.10.10
GPL-3
Authors
Timothy C. Bates [aut, cre] (<https://orcid.org/0000-0002-1153-9007>), Gillespie Nathan [wit], Michael Zakharin [wit], Brenton Wiernik [ctb], Joshua N. Pritikin [ctb], Michael C. Neale [ctb], Hermine Maes [ctb]
Initial release
2021-11-30

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.