Exercise

Reducing categories using outcome

Previously, we determined the proportions of discipline infractions for all 12 grade levels. We can create a data table, dgr_prop, containing these grade proportions mapping with grade and proportion columns. The proportions correspond to a student receiving disciplinary action during that grade.

View(dgr_prop)

   grade proportion
1      1 0.04813478
2      2 0.04603581
3      3 0.04000000
4      4 0.06042654
5      5 0.04519119
6      6 0.21577726
7      7 0.21153846
8      8 0.20161290
9      9 0.75153752
10    10 0.75413712
11    11 0.71428571
12    12 0.76079347

Instructions 1/2

undefined XP
    1
    2
  • Map the proportional values corresponding to the grade level information onto the discipline_logs data frame.
  • Display a glimpse of the new data frame.