mvmr.ivw | R Documentation |
Perform inverse-variance weighted (IVW) estimator for two-sample summary-data multivariable Mendelian randomization
mvmr.ivw(beta.exposure, se.exposure, beta.outcome, se.outcome, 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 |
gen_cor |
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. The correlations can either be estimated, be assumed to be zero, or fixed at zero using non-overlapping samples of each exposure GWAS. 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 |
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),c(1:4)]
mvmr.ivw(beta.exposure = beta.exposure,
se.exposure = se.exposure,
beta.outcome = beta.outcome,
se.outcome = se.outcome,
gen_cor = P)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.