mvmr.srivw | R Documentation |
Perform spectral regularized inverse-variance weighted (SRIVW) estimator for summary-data multivariable Mendelian randomization
mvmr.srivw(
beta.exposure,
se.exposure,
beta.outcome,
se.outcome,
phi_cand = 0,
over.dispersion = FALSE,
overlap = FALSE,
gen_cor = NULL
)
beta.exposure |
A data.frame or matrix. Each row contains the estimated marginal effect of a SNP on K exposures, usually obtained from a GWAS |
se.exposure |
A data.frame or matrix of estimated standard errors of beta.exposure |
beta.outcome |
A vector of the estimated marginal effect of a SNP on outcome, usually obtained from a GWAS |
se.outcome |
A vector of estimated standard errors of beta.outcome |
phi_cand |
A vector of tuning parameters for SRIVW estimator. Default is 0. To use the recommended set for the tuning parameter, simply set phi_cand = NULL. |
over.dispersion |
Should the model consider balanced horizontal pleiotropy? Default is FALSE. |
overlap |
Should the model consider overlapping exposure and outcome datasets? Default is FALSE. |
gen_cor |
If overlap = FALSE, provide a K-by-K matrix for the estimated shared correlation matrix between the effect of the genetic variants on each exposure, where K is the number of exposure. If overlap = TRUE, provide a (K+1)-by-(K+1) matrix for the estimated shared correlation matrix between the effect of the genetic variants on each exposure and the outcome, where the last index position corresponds to the outcome. The correlations can either be estimated, be assumed to be zero, or fixed at zero. Default input is NULL, meaning that an identity matrix is used as the correlation matrix. |
A list with elements
beta.hat |
Estimated direct effects of each exposure on the outcome |
beta.se |
Estimated standard errors of beta.hat |
iv_strength_parameter |
The minimum eigenvalue of the sample IV strength matrix, which quantifies the IV strength in the sample |
phi_selected |
The selected tuning parameter for the SRIVW estimator |
tau.square |
Overdispersion parameter if |
data("hdl_subfractions")
# We are going to estimate the effect of S-HDL-P on the risk of CAS with adjustments of HDL, LDL, and TG levels
beta.exposure <- hdl_subfractions$data[,c("gamma_exp1","gamma_exp2","gamma_exp3","gamma_exp4")] # corresponding to SNP effects on respectively HDL, LDL, TG, and S-HDL-P
se.exposure <- hdl_subfractions$data[,c("se_exp1","se_exp2","se_exp3","se_exp4")]
beta.outcome <- hdl_subfractions$data$gamma_out1
se.outcome <- hdl_subfractions$data$se_out1
P <- hdl_subfractions$cor.mat[c(1:4,10),c(1:4,10)] # make sure the last index corresponds to the outcome
mvmr.srivw(beta.exposure = beta.exposure,
se.exposure = se.exposure,
beta.outcome = beta.outcome,
se.outcome = se.outcome,
gen_cor = P,
phi_cand = NULL,
over.dispersion = FALSE,
overlap = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.