Change a model's tidy output
Use tidy_override
and tidy_replace
to provide your own p values,
confidence intervals etc. for a model.
tidy_override(x, ..., glance = list(), extend = FALSE) tidy_replace(x, tidied, glance = list()) ## S3 method for class 'tidy_override' tidy(x, ...) ## S3 method for class 'tidy_override' glance(x, ...) ## S3 method for class 'tidy_override' nobs(object, ...)
x |
A model with methods defined for |
... |
In |
glance |
A list of summary statistics for |
extend |
Logical: allow adding new columns to |
tidied |
Data frame to replace the result of |
object |
A |
tidy_override
allows you to replace some columns of tidy(x)
with your own data.
tidy_replace
allows you to replace the result of tidy(x)
entirely.
An object that can be passed in to huxreg
.
if (! requireNamespace("broom", quietly = TRUE)) { stop("Please install 'broom' to run this example.") } lm1 <- lm(mpg ~ cyl, mtcars) fixed_lm1 <- tidy_override(lm1, p.value = c(.04, .12), glance = list(r.squared = 0.99)) huxreg(lm1, fixed_lm1) if (requireNamespace("nnet", quietly = TRUE)) { mnl <- nnet::multinom(gear ~ mpg, mtcars) tidied <- broom::tidy(mnl) mnl4 <- tidy_replace(mnl, tidied[tidied$y.level == 4, ]) mnl5 <- tidy_replace(mnl, tidied[tidied$y.level == 5, ]) huxreg(mnl4, mnl5, statistics = "nobs") }
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.