A missing value is an observation whose value is unavailable, unrecorded, or not applicable. In R, NA represents a missing value and must be handled deliberately rather than ignored. section 2.3.5 section 11.4.1
Missingness often reflects the structure of the data rather than a simple error. The Charlotte Hornets and New Orleans Pelicans lack salary observations for seasons in which they were not active, so each team requires a different set of seasons before totals and averages are calculated. section 11.4.1
Common R checks and treatments include:
- Locate missing observations with is.na(), as with draft players whose College value is NA. section 2.3.5
- Replace NA when absence has a meaningful analytical interpretation; College values are replaced with 0 before creating a college-versus-no-college indicator. section 2.3.5
- Exclude or reshape incomplete periods before aggregation; salary columns are selected separately for teams with 15, 16, or 18 available seasons. section 11.4.1
- Check resulting categories and counts after transformation; factor summaries can reveal whether any NAs remain. section 14.5.1
Missing event and points values in play-by-play data
Missingness can remain after ordinary cleaning. In the regular-season play-by-play data, event_type contains 790 NA records, while points contains 267,122 NAs. These counts show why downstream summaries must account for which variables are missing and how that affects interpretation. section 8.4
draft$College[is.na(draft$College)] <- 0 mutate(draft, College2 = ifelse(College == 0, 0, 1)) -> draft draft$College2 <- as.factor(draft$College2)
See an executable pattern for identifying College values with is.na(), replacing them, and deriving a categorical indicator. section 2.3.5


































