View source: R/format_function.R
format_mvmr | R Documentation |
Reads in summary data. Checks and organises columns for use in calculating multivariable Mendelian Randomization analyses. Where variant IDs are not provided, a vector is generated for variant identification.
format_mvmr(BXGs, BYG, seBXGs, seBYG, RSID)
BXGs |
A matrix containing beta-coefficient values for genetic associations with the each exposure. Columns should indicate exposure number, with rows representing estimates for a given genetic variant. |
BYG |
A numeric vector of beta-coefficient values for genetic associations with the outcome. |
seBXGs |
A matrix containing standard errors corresponding to the matrix of beta-coefficients |
seBYG |
A numeric vector of standard errors corresponding to the beta-coefficients |
RSID |
A vector of names for genetic variants included in the analysis. If variant IDs are not provided ( |
A formatted data frame of class mvmr_format
.
Wes Spiller; Eleanor Sanderson; Jack Bowden.
Sanderson, E., et al., An examination of multivariable Mendelian randomization in the single-sample and two-sample summary data settings. International Journal of Epidemiology, 2019, 48, 3, 713-727. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1093/ije/dyy262")}
r_input <- format_mvmr(
BXGs = rawdat_mvmr[,c("LDL_beta","HDL_beta")],
BYG = rawdat_mvmr$SBP_beta,
seBXGs = rawdat_mvmr[,c("LDL_se","HDL_se")],
seBYG = rawdat_mvmr$SBP_se,
RSID = rawdat_mvmr$SNP)
names(r_input)
class(r_input)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.