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).
methods
mr_mvmedian( object, distribution ="normal", alpha =0.05, iterations =10000, seed =314159265)## S4 method for signature '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).
Returns
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)# iterations is set to 100 to reduce runtime for the mr_mvmedian method,# 10000 iterations are recommended in practice