dsi-principles-prog / midterm-wadem117

midterm-wadem117 created by GitHub Classroom
MIT License
0 stars 0 forks source link

Convert raw data to rates per 60 minutes #2

Closed wadem117 closed 4 years ago

wadem117 commented 4 years ago

A common way for hockey statisticians to standardize based on time on ice is referred to as "per 60 (minutes)" stats. Converting raw values into per 60 is quite simple:

value per 60 = (raw value/toi) x 60

I need to add columns which include the following variables as per-60 rates:

differential, cf, ca, ff, fa, sf, sa, gf, ga, xgf, xga, scf, sca, hdcf, hdca, hdsf, hdsa, hdgf, hdga, mdcf, mdca, mdsf, mdsa, mdgf, mdga, ldcf, ldca, ldsf, ldsa, ldgf, and ldga.

For example, say the Nashville Predators played a game with 50 minutes of five-on-five toi. In that time, they produced 30 cf. Converting to cf per 60 is easy:

(raw value/toi) x 60 = value per 60

(30 cf/50 toi) x 60 = 36 cf per 60

shaswat01 commented 4 years ago

added per_60 feature, closes #2