liveBook · Manning

Confidence interval

As explained in Statistics Slam Dunk

A confidence interval is an interval estimate constructed by a statistical procedure intended to contain a population parameter at a specified confidence level.

A confidence interval is a range around an estimate that expresses uncertainty about the actual value. In NBA regression, it surrounds predicted regular-season wins. section 5.7.7

Use confidence intervals to:

  • Report a fitted value together with lower and upper bounds, rather than treating the prediction as exact. section 5.7.7
  • Display uncertainty visually around a regression line or predicted values. section 14.4.1 section 5.7.7
  • Compare groups with notched boxplots, where the notch displays a confidence interval around the median. section 14.5.1

Predicting NBA wins

A fitted model predicts 44.04 wins for one test observation, with a 95% confidence interval from 37.34 to 50.74 wins. Combining these results with actual wins allows analysts to calculate prediction differences, summarize their average magnitude, and plot actual wins against predictions with shaded intervals. section 5.7.7

fit2_pred <- predict(fit2, data.frame(test), interval = "confidence")
print(fit2_pred)
##         fit      lwr      upr
## 1  44.03632 37.33518 50.73746
## 2  32.32559 27.22836 37.42282
## 3  36.66966 31.99864 41.34067
## 4  33.97327 29.54744 38.39910
## 5  34.30091 28.39030 40.21152
## 6  43.32909 35.93216 50.72603
## 7  41.24102 35.64396 46.83807
## 8  44.46051 40.78216 48.13886
## 9  38.46246 34.58980 42.33511
## 10 41.12360 36.88138 45.36582
## 11 44.69284 40.73769 48.64799
## 12 37.34022 33.95924 40.72119
## 13 45.32616 39.41971 51.23261
## 14 50.02897 43.31042 56.74753
## 15 37.18162 33.31884 41.04439
## 16 42.25199 35.84835 48.65562
## 17 33.46908 27.89836 39.03979
## 18 34.15238 26.87326 41.43151
## 19 41.70479 36.39175 47.01783
## 20 34.30830 28.03565 40.58094
## 21 33.20151 27.19351 39.20951
## 22 43.30823 36.75603 49.86043
## 23 36.77234 29.78770 43.75698

Inspect the R output showing predicted wins in fit and the interval endpoints in lwr and upr. section 5.7.7

How Statistics Slam Dunk covers it

How deep it goes
Defines interval bounds and demonstrates R plotting, but does not derive the statistical procedure or explain interval assumptions.
Examples
Demonstrates predicted NBA wins, shaded regression-line bands, and notched boxplots of standardized wins.
What it assumes
Assumes a fitted regression model, test data, and basic R data manipulation while defining interval outputs during application.
What you can do after
Apply it via R’s predict(), ggplot2’s geom_smooth(), and geom_ribbon() to calculate and visualize uncertainty.
How it connects
Connects confidence intervals with regression, prediction, standard error, correlation plots, and boxplots.

Also explained in

Compare how 10 books explain confidence interval →

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.