The range method standardizes a numeric variable by dividing each value by the difference between its maximum and minimum values. It places observations on a common scale and is especially useful when comparing variables measured in very different units. section 19.4.4 section 20.8
For NBA scoring, calculate the denominator within each season so players are compared with the scoring environment of their own year. Group the data by Year, create r_ppg with PPG divided by max(PPG) minus min(PPG), and round the result. section 19.4.4
Standardizing points per game by season
The R workflow creates r_ppg for every player, then groups the results by Year and selects the maximum standardized value. The leading scorer in each season receives 1.1 in the shown output, while lower values indicate smaller points-per-game values relative to that season's range. section 19.4.4
dat2 %>% group_by(Year) %>% mutate(r_ppg = round((PPG) / (max(PPG) - min(PPG)), digits = 1)) -> dat7a head(dat7a, n = 3) ## # A tibble: 3 × 5 ## # Groups: Year [1] ## Year Player PPG Year_Player r_ppg ## <fct> <chr> <dbl> <chr> <dbl> ## 1 1950 Al Guokas 3.8 1950 Al Guokas 0.2 ## 2 1950 Alex Groza 23.4 1950 Alex Groza 0.9 ## 3 1950 Alex Hannum* 7.5 1950 Alex Hannum* 0.3 tail(dat7a, n = 3) ## # A tibble: 3 × 5 ## # Groups: Year [1] ## Year Player PPG Year_Player r_ppg ## <fct> <chr> <dbl> <chr> <dbl> ## 1 1999 Walt Williams 9.3 1999 Walt Williams 0.4 ## 2 1999 Walter McCarty 5.7 1999 Walter McCarty 0.2 ## 3 1999 Will Perdue 2.4 1999 Will Perdue 0.1
Inspect the complete R transformation and its first and last records, including the calculated r_ppg values. section 19.4.4
