liveBook · Manning

Missing value

As explained in Statistics Slam Dunk

A missing value or missing data item is an observation whose value is unavailable, unrecorded, or not applicable in a dataset.

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

How Statistics Slam Dunk covers it

How deep it goes
Defines NA and demonstrates detection, replacement, exclusion, reshaping, and validation, but does not develop general missing-data theory.
Examples
Uses missing colleges, inactive-team seasons, play-by-play event types, points, and categorized NBA statistics.
What it assumes
Assumes basic R data-frame and variable knowledge while introducing NA detection, factor conversion, and conditional recoding.
What you can do after
Diagnose/debug with it: locate NAs, choose replacements or exclusions, reshape incomplete records, and verify resulting summaries.
How it connects
Connects missing values to data wrangling, factor variables, derived variables, aggregation, and data visualization.

Also explained in

Compare how 35 books explain missing value →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Statistics Slam Dunk. The section links point to the parts of the book it draws on.