| format_model_table | R Documentation |
Transforms raw model coefficient data into a formatted table suitable for publication. Handles effect measure formatting (OR, HR, RR, Estimate), confidence intervals, p-values, sample sizes, and variable labels. Supports interaction terms and mixed-effects models.
format_model_table(
data,
effect_col = NULL,
digits = 2,
p_digits = 3,
labels = NULL,
show_n = TRUE,
show_events = TRUE,
reference_label = "reference",
exponentiate = NULL,
conf_level = 0.95,
marks = NULL
)
data |
Data.table containing raw model results with coefficient columns. |
effect_col |
Optional character string specifying the effect column name.
If |
digits |
Integer number of decimal places for effect estimates. |
p_digits |
Integer number of decimal places for p-values. |
labels |
Optional named character vector mapping variable names to display labels. Supports automatic labeling of interaction terms. |
show_n |
Logical whether to include sample size column. |
show_events |
Logical whether to include events column (ignored for linear models). |
reference_label |
Character string to display for reference categories. |
exponentiate |
Optional logical to force exponentiated (TRUE) or raw (FALSE)
coefficient display. If |
Formatted data.table with publication-ready columns.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.