# NOT RUN {
library(dplyr)
gear_counts <- mtcars %>%
count(vs, gear)
gear_counts
# find the number of gears most characteristic of each engine shape `vs`
regularized <- gear_counts %>%
bind_log_odds(vs, gear, n)
regularized
unregularized <- gear_counts %>%
bind_log_odds(vs, gear, n, uninformative = TRUE, unweighted = TRUE)
# these log odds will be farther from zero
# than the regularized estimates
unregularized
# }
Run the code above in your browser using DataLab