View source: R/create_OR_table.R
create_OR_table | R Documentation |
This function creates a table displaying odds ratios with confidence intervals for logistic regression models.
create_OR_table(
...,
output_format = c("markdown", "latex", "html", "plaintext"),
bootstrap_options = NULL
)
... |
One or more logistic regression models. |
output_format |
The output format for the table. Can be "markdown", "latex", "html", or "plaintext". Default is "plaintext". |
bootstrap_options |
A character vector of Bootstrap table styles for HTML output. Default is NULL. |
Displays a formatted table of odds ratios with confidence intervals.
# Simulate data
set.seed(123)
dataset <- data.frame(
response = sample(c(0, 1), 100, replace = TRUE),
var1 = rnorm(100),
var2 = rnorm(100),
var3 = rnorm(100)
)
# Fit logistic regression models
model1 <- glm(response ~ var1 + var2, family = binomial, data = dataset)
model2 <- glm(response ~ var1 + var2 + var3, family = binomial, data = dataset)
# Create OR table as plaintext
create_OR_table(model1, model2)
# Create OR table with custom bootstrap options and HTML
create_OR_table(model1, model2, output_format="html", bootstrap_options = c("striped", "hover"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.