Skip to contents

The mr_mvmedian function performs multivariable Mendelian randomization via the median method. This is implemented by multivariable weighted quantile regression, with the quantile set to 0.5 (the median).

Usage

mr_mvmedian(
  object,
  distribution = "normal",
  alpha = 0.05,
  iterations = 10000,
  seed = 314159265
)

# S4 method for MRMVInput
mr_mvmedian(
  object,
  distribution = "normal",
  alpha = 0.05,
  iterations = 10000,
  seed = 314159265
)

Arguments

object

An MRMVInput object.

distribution

The type of distribution used to calculate the confidence intervals. Options are "normal" (default) or "t-dist".

alpha

The significance level used to calculate the confidence intervals. The default value is 0.05.

iterations

The number of bootstrap samples to generate when calculating the estimated standard error. The default value is 10000.

seed

The random seed to use when generating the bootstrap samples (for reproducibility). The default value is 314159265. If set to NA, the random seed will not be set (for example, if the function is used as part of a larger simulation).

Value

The output from the function is an MVMedian object containing:

Exposure

A character vector with the names given to the exposure.

Outcome

A character string with the names given to the outcome.

Estimate

A vector of causal estimates.

StdError

A vector of standard errors of the causal estimates.

CILower

The lower bounds of the causal estimates based on the estimated standard errors and the significance level provided.

CIUpper

The upper bounds of the causal estimates based on the estimated standard errors and the significance level provided.

Alpha

The significance level used when calculating the confidence intervals.

Pvalue

The p-values associated with the estimates (calculated as Estimate/StdError as per Wald test) using a normal or t-distribution (as specified in distribution).

SNPs

The number of genetic variants (SNPs) included in the analysis.

Details

The multivariable median method is similar to the univariable weighted median method, except that it is implemented using quantile regression. The regression model is multivariable and weighted by the inverse of the variances of the variant-specific estimates. Confidence intervals are calculated by parametric bootstrap to estimate the standard error of the estimates, and then using quantiles of a normal or t-distribution (depending on the value of distribution).

Examples

mr_mvmedian(mr_mvinput(bx = cbind(ldlc, hdlc, trig), bxse = cbind(ldlcse, hdlcse, trigse),
   by = chdlodds, byse = chdloddsse), iterations = 100)
#> 
#> Multivariable median method 
#> 
#> Number of variants : 28 
#> ------------------------------------------------------------------
#>    Exposure Estimate Std Error  95% CI       p-value
#>  exposure_1    2.116     0.496  1.145, 3.088   0.000
#>  exposure_2    0.111     0.700 -1.261, 1.483   0.874
#>  exposure_3    1.039     0.256  0.538, 1.540   0.000
#> ------------------------------------------------------------------
  # iterations is set to 100 to reduce runtime for the mr_mvmedian method,
  # 10000 iterations are recommended in practice