Mean absolute deviation measures spread by averaging the absolute differences between observations and their mean. It helps assess consistency, volatility, and parity rather than relying on a center alone. section 18.0 section 20.7
For each observation, subtract the group mean, take the absolute value, add those deviations, and divide by the number of observations. The method is less sensitive to outliers than variance and standard deviation. section 18.4.4 section 20.7
NBA regular-season wins
Group NBA records by season, calculate each team’s absolute distance from that season’s mean wins, then average those distances. Values ranged from 8.71 in 1970–71 to 12.6 in 1997–98. The resulting chart suggested that the salary cap did not improve intra-season parity during the examined period. section 18.4.4
records %>% group_by(Season) %>% mutate(mad_wins = abs(W - mean(W))) -> mad_records head(mad_records, n = 3) ## # A tibble: 3 × 6 ## # Groups: Season [3] ## Season Lg Team W L mad_wins ## <chr> <chr> <chr> <int> <int> <dbl> ## 1 1997-98 NBA Boston Celtics 36 46 5 ## 2 1996-97 NBA Boston Celtics 15 67 26 ## 3 1995-96 NBA Boston Celtics 33 49 8 tail(mad_records, n = 3) ## # A tibble: 3 × 6 ## # Groups: Season [3] ## Season Lg Team W L mad_wins ## <chr> <chr> <chr> <int> <int> <dbl> ## 1 1997-98 NBA Vancouver Grizzlies 19 63 22 ## 2 1996-97 NBA Vancouver Grizzlies 14 68 27 ## 3 1995-96 NBA Vancouver Grizzlies 15 67 26
Create a grouped R variable containing each team’s absolute deviation from its season mean. section 18.4.4
