Collection of custom tidiers
tidy_standardize( x, exponentiate = FALSE, conf.level = 0.95, conf.int = TRUE, ..., quiet = FALSE ) tidy_bootstrap( x, exponentiate = FALSE, conf.level = 0.95, conf.int = TRUE, ..., quiet = FALSE ) pool_and_tidy_mice(x, pool.args = NULL, ..., quiet = FALSE) tidy_gam(x, conf.int = FALSE, exponentiate = FALSE, conf.level = 0.95, ...)
x |
a regression model object |
exponentiate |
Logical indicating whether or not to exponentiate the
the coefficient estimates. This is typical for logistic and multinomial
regressions, but a bad idea if there is no log or logit link. Defaults
to |
conf.level |
The confidence level to use for the confidence interval
if |
conf.int |
Logical indicating whether or not to include a confidence
interval in the tidied output. Defaults to |
... |
arguments passed to method;
|
quiet |
Logical indicating whether to print messages in console. Default is
|
pool.args |
named list of arguments passed to |
tidy_standardize()
tidier to report standardized coefficients. The
effectsize
package includes a wonderful function to estimate standardized coefficients.
The tidier uses the output from effectsize::standardize_parameters()
, and
merely takes the result and puts it in broom::tidy()
format.
tidy_bootstrap()
tidier to report bootstrapped coefficients. The
parameters
package includes a wonderful function to estimate bootstrapped coefficients.
The tidier uses the output from parameters::bootstrap_parameters(test = "p")
, and
merely takes the result and puts it in broom::tidy()
format.
pool_and_tidy_mice()
tidier to report models resulting from multiply imputed data
using the mice package. Pass the mice model object before the model results
have been pooled. See example.
Ensure your model type is compatible with the methods/functions used to estimate
the model parameters before attempting to use the tidier with tbl_regression()
Example 1
Example 2
Example 3
# Example 1 ---------------------------------- mod <- lm(age ~ marker + grade, trial) tbl_stnd <- tbl_regression(mod, tidy_fun = tidy_standardize) tbl <- tbl_regression(mod) if (requireNamespace("effectsize")) { tidy_standardize_ex1 <- tbl_merge( list(tbl_stnd, tbl), tab_spanner = c("**Standardized Model**", "**Original Model**") ) } # Example 2 ---------------------------------- # use "posthoc" method for coef calculation if (requireNamespace("parameters")) { tidy_standardize_ex2 <- tbl_regression(mod, tidy_fun = purrr::partial(tidy_standardize, method = "posthoc")) } # Example 3 ---------------------------------- # Multiple Imputation using the mice package set.seed(1123) if (requireNamespace("mice")) { pool_and_tidy_mice_ex3 <- suppressWarnings(mice::mice(trial, m = 2)) %>% with(lm(age ~ marker + grade)) %>% tbl_regression() } # mice method called that uses `pool_and_tidy_mice()` as tidier
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.