I wanted to look at NBA shooting stats.
The question is:
Do teams with better shooting percentages usually win more games?
This uses 2023-24 NBA regular season team data.
The data is from Basketball-Reference team stats and standings.
I used three variables:
## team wins fg three pred resid
## 1 Boston 64 48.7 38.8 47.90252 16.097477
## 2 Denver 57 49.6 37.4 52.79408 4.205925
## 3 Oklahoma City 57 49.9 38.9 54.42459 2.575407
## 4 Minnesota 56 48.5 38.7 46.81551 9.184488
## 5 LA Clippers 51 48.9 38.1 48.98953 2.010465
## 6 Dallas 50 48.1 36.9 44.64149 5.358511
Correlation is used to measure how two variables move together.
\[ r = \frac{\sum (x_i - \bar{x})(y_i - \bar{y})}{\sqrt{\sum (x_i - \bar{x})^2\sum (y_i - \bar{y})^2}} \]
For this project, \(x\) is field goal percentage and \(y\) is wins.
## `geom_smooth()` using formula = 'y ~ x'
I also used a simple linear regression model.
\[ \widehat{wins} = b_0 + b_1(fg) \]
This means the model predicts wins from field goal percentage.
## (Intercept) fg
## -216.784792 5.435058
The slope is positive, so higher field goal percentage is connected with more wins in this data.
This does not mean shooting is the only reason teams win.
A residual is how far off the prediction was.
\[ e_i = y_i - \widehat{y_i} \]
A positive residual means the team won more games than the model predicted.
## `geom_smooth()` using formula = 'y ~ x'
The teams with better field goal percentage usually had more wins.
There are also some teams that do not fit perfectly. That makes sense because wins also depend on defense, injuries, turnovers, coaching, and schedule.