R/ff_newdata.R
summary_df.Rd
When producing conditional estimates from a regression model, it is often useful to set variables not of interest to their mode for factors and mean or median for numerics when creating the newdata object.
summary_df(.data, cont = "mean")
A data frame or tibble.
One of "mean" or "median": the summary estimate for continuous variables.
A data frame or tibble with the mode for factors and mean/median for continuous variables.
library(dplyr)
colon_s %>%
select(age, sex.factor, obstruct.factor, perfor.factor) %>%
summary_df()
#> age sex.factor obstruct.factor perfor.factor
#> 1 59.75457 Male No No
colon_s %>%
select(age, sex.factor, obstruct.factor, perfor.factor) %>%
summary_df(cont = "median")
#> age sex.factor obstruct.factor perfor.factor
#> 1 61 Male No No