interactionR_table: Publication-ready tables for effect modification and...

View source: R/interactionR_table.R

interactionR_tableR Documentation

Publication-ready tables for effect modification and interaction analysis

Description

Generates a publication-ready table for effect modification and interaction analysis based on Tables 1 and 3 in Knol and Vanderweele (2012) [doi: 10.1093/ije/dyr218]. Users can modify the function's output like any flextable object @seealso flextable. The confidence intervals for additive interaction measures will be as selected from the interactionR function

Usage

interactionR_table(obj, p.value = FALSE, file_path = NA)

Arguments

obj

An object of class 'interactionR' generated from any of the main functions in the interactionR package

p.value

Includes p-values in the generated table if set to TRUE. Default is FALSE.

file_path

An optional user-specified string representing the file path to save the generated Word table instead of the current working directory

Value

saves a publication-ready microsoft word Table corresponding to Table 1 or Table 3 respectively in Knol and Vanderweele (2012) to the working directory (with user's permission). It also returns an object of class flextable corresponding to the saved table for further manipulation.

Examples

library(interactionR)
data(OCdata)

## fit the interaction model
model.glm <- glm(oc ~ alc * smk,
  family = binomial(link = "logit"),
  data = OCdata
)
## Then pass the fitted model to the main function
value <- interactionR(model.glm,
  exposure_names = c("alc", "smk"),
  ci.type = "delta", ci.level = 0.95,
  em = FALSE, recode = FALSE
)

## Use the tabling function to generate a table
interactionR_table(value)

interactionR documentation built on June 7, 2022, 1:07 a.m.