Skip to contents

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

Retained for interface consistency with the other MVMR functions. The IVW point estimates do not depend on the covariance between the effect of the genetic variants on each exposure, so this argument is not used by ivw_mvmr(). A value of 0 is used by default.

Value

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

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. doi:10.1093/ije/dyy262

Author

Wes Spiller; Eleanor Sanderson; Jack Bowden.

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)
#> 
#> Multivariable MR
#> 
#>               Estimate Std. Error    t value  Pr(>|t|)
#> exposure1 -0.031003996 0.01302925 -2.3795686 0.0186526
#> exposure2  0.006039167 0.01029181  0.5867933 0.5582678
#> 
#> Residual standard error: 2.209 on 143 degrees of freedom
#> 
#> 
#>               Estimate Std. Error    t value  Pr(>|t|)
#> exposure1 -0.031003996 0.01302925 -2.3795686 0.0186526
#> exposure2  0.006039167 0.01029181  0.5867933 0.5582678