View source: R/ff_remove_ref.R
ff_remove_ref | R Documentation |
This looks for a column with a name including "Coefficient", "OR", or "HR"
(finalfit
defaults) and removes any rows with "-" (the default
for the reference level). Can also be combined to produce an
or_plot
, see below.
ff_remove_ref(.data, only_binary = TRUE)
finalfit_remove_ref(.data, only_binary = TRUE)
.data |
Output from |
only_binary |
Logical. Remove reference level only for two-level factors. When set to false, reference level for all factors removed. |
Data frame.
# Table example
explanatory = c("age.factor", "age", "sex.factor", "nodes", "obstruct.factor", "perfor.factor")
dependent = 'mort_5yr'
colon_s %>%
finalfit(dependent, explanatory, add_dependent_label = FALSE) %>%
ff_remove_ref() %>%
dependent_label(colon_s, dependent)
# Plot example
explanatory = c("age.factor", "age", "sex.factor", "nodes", "obstruct.factor", "perfor.factor")
dependent = 'mort_5yr'
colon_s %>%
summary_factorlist(dependent, explanatory, total_col = TRUE, fit_id=TRUE) %>%
ff_merge(
glmuni(colon_s, dependent, explanatory) %>%
fit2df()) %>%
ff_remove_ref() %>%
dplyr::select(-`OR`) -> factorlist_plot
colon_s %>%
or_plot(dependent, explanatory, factorlist = factorlist_plot)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.