View source: R/interactionR_table.R
interactionR_table | R Documentation |
Generates a publication-ready table for effect modification and interaction analysis based on Tables 1 and 3 in Knol and Vanderweele (2012) [\Sexpr[results=rd]{tools:::Rd_expr_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
interactionR_table(obj, p.value = FALSE, file_path = NA)
obj |
An object of class 'interactionR' generated from any of the main functions in the |
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 |
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.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.