ivw_mvmr: ivw_mvmr

View source: R/ivw_mvmr.R

ivw_mvmrR Documentation

ivw_mvmr

Description

Fits an IVW multivariable Mendelian randomization model using first order weights.

Usage

ivw_mvmr(r_input, gencov = 0)

Arguments

r_input

A formatted data frame using the format_mvmr function or an object of class MRMVInput from MendelianRandomization::mr_mvinput

gencov

Calculating heterogeneity statistics requires the covariance between the effect of the genetic variants on each exposure to be known. This can either be estimated from individual level data, be assumed to be zero, or fixed at zero using non-overlapping samples of each exposure GWAS. A value of 0 is used by default.

Value

An dataframe containing MVMR results, including estimated coefficients, their standard errors, t-statistics, and corresponding (two-sided) p-values.

Author(s)

Wes Spiller; Eleanor Sanderson; Jack Bowden.

References

Sanderson, E., et al., An examination of multivariable Mendelian randomization in the single-sample and two-sample summary data settings. International Journal of Epidemiology, 2019, 48, 3, 713-727. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/ije/dyy262")}

Examples

r_input <- format_mvmr(
    BXGs = rawdat_mvmr[,c("LDL_beta","HDL_beta")],
    BYG = rawdat_mvmr$SBP_beta,
    seBXGs = rawdat_mvmr[,c("LDL_se","HDL_se")],
    seBYG = rawdat_mvmr$SBP_se,
    RSID = rawdat_mvmr$SNP)
ivw_mvmr(r_input)

WSpiller/MVMR documentation built on May 17, 2023, 5:48 p.m.