mr.raps.mle | R Documentation |
Main function for RAPS (MLE weights)
mr.raps.all
: Quick analysis with all six MLE methods
mr.raps.simple
: No overdispersion, l2 loss
mr.raps.overdispersed
: Overdispersion, l2 loss
mr.raps.simple.robust
: No overdispersion, robust loss
mr.raps.overdispersed.robust
: Overdispersed, robust loss
mr.raps.mle( b_exp, b_out, se_exp, se_out, over.dispersion = FALSE, loss.function = c("l2", "huber", "tukey"), diagnostics = FALSE, pruning = TRUE, se.method = c("sandwich", "bootstrap"), k = switch(loss.function[1], l2 = NULL, huber = 1.345, tukey = 4.685), B = 1000, suppress.warning = FALSE ) mr.raps.mle.all(b_exp, b_out, se_exp, se_out) mr.raps.simple(b_exp, b_out, se_exp, se_out, diagnostics = FALSE) mr.raps.overdispersed( b_exp, b_out, se_exp, se_out, initialization = c("simple", "mode"), suppress.warning = FALSE, diagnostics = FALSE, pruning = TRUE, niter = 20, tol = .Machine$double.eps^0.5 ) mr.raps.simple.robust( b_exp, b_out, se_exp, se_out, loss.function = c("huber", "tukey"), k = switch(loss.function[1], huber = 1.345, tukey = 4.685), diagnostics = FALSE ) mr.raps.overdispersed.robust( b_exp, b_out, se_exp, se_out, loss.function = c("huber", "tukey"), k = switch(loss.function[1], huber = 1.345, tukey = 4.685), initialization = c("l2", "mode"), suppress.warning = FALSE, diagnostics = FALSE, pruning = TRUE, niter = 20, tol = .Machine$double.eps^0.5 )
b_exp |
A vector of SNP effects on the exposure variable, usually obtained from a GWAS. |
b_out |
A vector of SNP effects on the outcome variable, usually obtained from a GWAS. |
se_exp |
A vector of standard errors of |
se_out |
A vector of standard errors of |
over.dispersion |
Should the model consider overdispersion (systematic pleiotropy)? Default is FALSE. |
loss.function |
Either the squared error loss ( |
diagnostics |
Should the function returns diagnostic plots and results? Default is FALSE |
pruning |
Should the function remove unusually large |
se.method |
How should the standard error be estimated? Either by sandwich variance formula (default and recommended) or the bootstrap. |
k |
Threshold parameter in the Huber and Tukey loss functions. |
B |
Number of bootstrap resamples |
suppress.warning |
Should warning messages be suppressed? |
initialization |
Method to initialize the robust estimator. "Mode" is not supported currently. |
niter |
Maximum number of interations to solve the estimating equations. |
tol |
Numerical precision. |
mr.raps.mle
is the main function for RAPS. It is replaced by the more general and robust function mr.raps.shrinkage
.
A list
Estimated causal effect
Standard error of beta.hat
Two-sided p-value of beta.hat
Overdispersion parameter if over.dispersion = TRUE
Standard error of tau2.hat
Standardized residuals of each SNP, returned if diagnostics = TRUE
Leave-one-out estimates of beta.hat
, returned if diagnostics = TRUE
Median of the bootstrap estimates, returned if se.method = "bootstrap"
Median absolute deviation of the bootstrap estimates, returned if se.method = "bootstrap"
mr.raps.mle.all
:
mr.raps.simple
:
mr.raps.overdispersed
:
mr.raps.simple.robust
:
mr.raps.overdispersed.robust
:
Qingyuan Zhao, Jingshu Wang, Gibran Hemani, Jack Bowden, Dylan S. Small. Statistical inference in two-sample summary-data Mendelian randomization using robust adjusted profile score. https://arxiv.org/abs/1801.09652.
data(bmi.sbp) attach(bmi.sbp) ## All estimators mr.raps.mle.all(beta.exposure, beta.outcome, se.exposure, se.outcome) ## Diagnostic plots res <- mr.raps.mle(beta.exposure, beta.outcome, se.exposure, se.outcome, diagnostics = TRUE) res <- mr.raps.mle(beta.exposure, beta.outcome, se.exposure, se.outcome, TRUE, diagnostics = TRUE) res <- mr.raps.mle(beta.exposure, beta.outcome, se.exposure, se.outcome, TRUE, "tukey", diagnostics = TRUE) detach(bmi.sbp) data(bmi.bmi) attach(bmi.bmi) ## Because both the exposure and the outcome are BMI, the true "causal" effect should be 1. ## All estimators mr.raps.mle.all(beta.exposure, beta.outcome, se.exposure, se.outcome) detach(bmi.bmi)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.