nice_regression_table.RdCreate a nice table from one or more regression models
One or more model objects (e.g., objects of class lm, glm,
lme, lmerModLmerTest, glmerMod).
Number of decimal places to round numeric values.
Character vector with labels for each model. If NULL, the model formula is used.
A named list to rename predictor labels.
A named list to rename column names.
Either column number or column names to be removed
If TRUE, common column names are automatically renamed (e.g., "Std. Error" to "SE", "Pr (>|t|)" to "p", etc.).
If provided, the resulting table is also written to the specified file (e.g., an Excel file).
If TRUE, the estimators are assumed to be logits and are exponentiated to yield odds ratios
If TRUE, p values are formatted nicely
Title of the table.
Footnote of the table.
lm(mpg ~ am + disp + hp, data = mtcars) |>
nice_regression_table()
Table
Regression model
Estimate
SE
t
p
Model
nice_regression_table(
nlme::lme(mpg~disp, data = mtcars, random = ~1|am),
nlme::lme(mpg~disp + hp, data = mtcars, random = ~1|am)
)
Table
Regression model
Estimate
SE
DF
t
p-value
Estimate
SE
DF
t
p-value
Model
nice_regression_table(
wmisc:::model_lmer_1, wmisc:::model_lmer_2,
rename_labels = list(
"EffectTrend" = "Trend", "EffectSlope" = "Slope", "TimePost" = "Post",
"ConditionTraining" = "Training", "id_subject" = "Subject"),
rename_cols = list("Estimate" = "B", "SE" = "se"),
labels_models = c("Only pretest", "Pre- and posttest")
)
#> Loading required namespace: lmerTest
Table
Regression model
B
se
df
t
p
B
se
df
t
p
Model