Session Ready
Exercise

Categorical proportions by outcome

The grade variable in the discipline_logs dataset contains 12 distinct categories we wish to incorporate into our model that predict whether or not a student received a disciplinary action. We want to reduce these 12 categories in a meaningful way that leverages the outcomes associated with these grade levels. The discipline variable indicates whether a student received disciplinary action.

Instructions
100 XP
  • Create a table, called discipline_table, of the frequencies of whether students get disciplined or not by each grade level.
  • Create a proportions table, called prop_table, that maps the proportions of whether students get disciplined by each grade.