osmr: A function to perform a one sample MR

View source: R/osmr.R

osmrR Documentation

A function to perform a one sample MR

Description

This function performs a one sample MR, including the observational (oe: outcome on exposure) analysis, the exposure on instrument (ei) analysis, and the Mendelian Randomization (MR) or instrumental variable analysis.

Usage

osmr(
  wdata,
  outcome,
  exposure,
  instrument,
  covariates = NA,
  outcome_model_family = "gaussian",
  exposure_model_family = "gaussian",
  weights = NA,
  rnt_outcome = FALSE
)

Arguments

wdata

a data frame of data with appropriate column names

outcome

a string defining the outcome (column) name

exposure

a string defining the exposure (column) name

instrument

a string defining the instrument (column) name

covariates

a vector of covariate (column) names

outcome_model_family

gaussian or binomial- should the outcome be modeled as a gaussian or binomial

exposure_model_family

gaussian or binomial - should the exposure be modeled as a gaussian or binomial

weights

if needed, a string defining the weights (column) name

rnt_outcome

TRUE or FALSE should the outcome trait be rank normal transformed

Value

a vector of summary statistics

Examples

osmr()

hughesevoanth/moosefun documentation built on Aug. 22, 2022, 7:04 a.m.