ivregfit: MR (ivreg) model fitting

View source: R/ivregfit.R

ivregfitR Documentation

MR (ivreg) model fitting

Description

This function fits instrumental variable (MR, ivreg) models

Usage

ivregfit(
  wdata,
  outcome,
  exposure,
  instrument,
  covariates = NA,
  weights_variable = NA,
  rnt_outcome = FALSE
)

Arguments

wdata

a data frame passed to function containing necessary data for analysis

outcome

a single string character of the column name for the outcome or dependent or response variable

exposure

a single string character of the column name for the exposure or independent or explanatory variable

instrument

a data frame passed to function containing necessary data for analysis

covariates

a character vector that are also column names used to define variables that will be set as covariates.

weights_variable

a single string character of the column name for a weights variable

rnt_outcome

binary TRUE or FALSE if the dependent or response variable should be rank normal transformed.

Value

returns a ivreg object that is a list containing (1) 'fit' a ivreg() object and (2) 'summary' a vector of summary statistics.

Examples

ivregfit()

hughesevoanth/glsmr documentation built on May 14, 2023, 3:41 p.m.