14 Intermediate and advanced modeling

 

This chapter covers

  • Fitting and evaluating analysis of variance models and logistic regressions
  • Computing probabilities, odds ratios, and log odds
  • Computing and plotting sensitivity and specificity
  • Running correlation tests
  • Creating new and improved boxplots

The idea that “defense wins championships” might have come from legendary college football coach Paul “Bear” Bryant, who led the Alabama Crimson Tide to six national titles in the 1960s and 1970s. The same idea then extended into basketball, especially the NBA. Despite the fact that NBA teams spend roughly half their time and effort playing offense and the other half playing defense, the view that defense matters more than offense took hold and remains part of the sport’s conventional wisdom.

Our purpose here is to repeatedly test the idea that defense, much more than offense, influences regular season wins and playoff appearances in the NBA. We’ll compute correlation coefficients; run correlation tests; demonstrate how to fit and evaluate an analysis of variance (ANOVA) model, which is a type of statistical model used to analyze the differences between three or more group means and determine the significance of these differences; and show how to fit and evaluate a logistic regression, which is the most popular method of solving classification problems—all while comparing and contrasting the effects of defense versus offense.

14.1 Loading packages

14.2 Importing and wrangling data

14.2.1 Subsetting and reshaping our data

14.2.2 Extracting a substring to create a new variable

14.2.3 Joining data

14.2.4 Importing and wrangling additional data sets

14.2.5 Joining data (one more time)

14.2.6 Creating standardized variables

14.3 Exploring data

14.4.1 Computing and plotting correlation coefficients