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

Description Usage Arguments Value Examples

View source: R/mr_format.R

Description

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

Usage

1
mr_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 numeric vector of the instrument-phenotype associations.

ybeta

A numeric vector of the instrument-outcome associations.

xse

The standard errors of the instrument-phenotype associations xbeta.

yse

The standard errors of the instrument-outcome associations ybeta.

Value

A formatted data frame for analysis of class mr_format.

Examples

1
2
3
4
5
6
7
data(bmi_insulin)
dat <- mr_format(rsid = bmi_insulin[,"rsid"],
          xbeta = bmi_insulin[,"beta.exposure"],
          ybeta = bmi_insulin[,"beta.outcome"],
          xse = bmi_insulin[,"se.exposure"],
          yse = bmi_insulin[,"se.outcome"])
class(dat)

mrbayes documentation built on Oct. 2, 2021, 5:08 p.m.