Skip to contents

Creates a data.frame with additional classes rmvmr_format and mvmr_format from an object of class MRMVInput generated by MendelianRandomization::mr_mvinput.

Usage

mrmvinput_to_rmvmr_format(dat)

Arguments

dat

Object from MendelianRandomization::mr_mvinput.

Value

data.frame with additoinal classes rmvmr_format, the RMVMR format, and mvmr_format.

Examples

if (require("MendelianRandomization", quietly = TRUE)) {
bx <- as.matrix(rawdat_rmvmr[,c("ldl_beta", "hdl_beta")])
bxse <- as.matrix(rawdat_rmvmr[,c("ldl_se", "hdl_se")])
dat <- MendelianRandomization::mr_mvinput(bx = bx,
                                          bxse = bxse,
                                          by = rawdat_rmvmr$sbp_beta,
                                          byse = rawdat_rmvmr$sbp_se,
                                          snps = rawdat_rmvmr$snp)
dat <- mrmvinput_to_rmvmr_format(dat)
head(dat)
class(dat)
}
#> [1] "data.frame"   "rmvmr_format" "mvmr_format"