View source: R/mrmvinput_to_mvmr_format.R
mrmvinput_to_mvmr_format | R Documentation |
Creates a data.frame with additional class mvmr_format
from an object of class MRMVInput
generated by MendelianRandomization::mr_mvinput
.
mrmvinput_to_mvmr_format(dat)
dat |
Object from |
Object of class mvmr_format
, the MVMR format
if (require("MendelianRandomization", quietly = TRUE)) {
bx <- as.matrix(rawdat_mvmr[,c("LDL_beta", "HDL_beta")])
bxse <- as.matrix(rawdat_mvmr[,c("LDL_se", "HDL_se")])
dat <- MendelianRandomization::mr_mvinput(bx = bx,
bxse = bxse,
by = rawdat_mvmr$SBP_beta,
byse = rawdat_mvmr$SBP_se,
snps = rawdat_mvmr$SNP)
dat <- mrmvinput_to_mvmr_format(dat)
head(dat)
class(dat)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.