mvmr_format: Organises the summary level data for use in the Bayesian MR...

View source: R/mvmr_format.R

mvmr_formatR Documentation

Organises the summary level data for use in the Bayesian MR functions

Description

Organises the summary level data for use in the Bayesian MR functions

Usage

mvmr_format(rsid, xbeta, ybeta, xse, yse)

Arguments

rsid

A vector of genetic variants used for analysis, if unspecified a vector is automatically generated.

xbeta

A matrix of multiple instrument-phenotypes associations.

ybeta

A numeric vector of the instrument-outcome associations.

xse

The matrix for corresponding standard errors of the instrument-phenotypes associations xbeta.

yse

The standard errors of the instrument-outcome associations ybeta.

Value

A formatted data frame for analysis of class mvmr_format.

Examples

data(dodata)
dat <- mvmr_format(
  rsid = dodata$rsid,
  xbeta = cbind(dodata$ldlcbeta,dodata$hdlcbeta,dodata$tgbeta),
  ybeta = dodata$chdbeta,
  xse = cbind(dodata$ldlcse,dodata$hdlcse,dodata$tgse),
  yse = dodata$chdse
)
class(dat)

mrbayes documentation built on Sept. 11, 2024, 6:45 p.m.