Lesson 20: Pearson Correlation Coefficient and R-Squared
Review:
- Linear Regression
- Exam 2 corrections
- Only for test takers who took Exam 2 on the scheduled date.
- You must complete this entire exam.
- Your exam score will increase up to 10 points or up to 50% of points deducted, whichever is less. For example, if you received an 88 on the exam you can only earn up to 6 points.
- Your actual points awarded will be based on your exam score. For example, if you get an 80% on the new exam, you will earn 8/10 points (or .8 x 50% of points deducted).
Presentation:
- Pearson Correlation Coefficient
- r = SSxy/√(SSxx*SSyy)
- -1 < r < 1
- R-Squared
- Calculate r and then square the result, i.e., =r^2
- 0 < r^2 < 1
- Let’s solve this problem from last time, including calculating r and r^2, from beginning to end.
Problem 2. A local brewery tracks weekly social media ad spending and kegs sold. Calculate Sum of Squares and the equation of the regression line.
| Week | Ad Spend (x, $100’s) | Kegs Sold (y) |
|---|---|---|
| 1 | 2 | 11 |
| 2 | 3 | 15 |
| 3 | 4 | 17 |
| 4 | 5 | 20 |
| 5 | 7 | 26 |
| 6 | 9 | 30 |
Let’s also estimate kegs sold when the ad spend is $650 (x=6.5)
Video: Fitting Lines to Data
Activity:
Now, here’s some real data, gathered from USDA National Water and Climate Center and the USGS Water Data Center. The snowpack data (snow-water equivalent inches) is for the Freemont Pass location. The streamflow data (ft^3/SEC) is for the Arkansas River station in Pueblo.
| Water Year | Snowpack (x) | Streamflow (y) |
| 2018 | 20.4 | 577.5 |
| 2019 | 28.1 | 1599.3 |
| 2020 | 20.2 | 901.0 |
| 2021 | 15.5 | 659.4 |
| 2022 | 17.6 | 730.4 |
| 2023 | 17.1 | 1016.0 |
| 2024 | 22.2 | 1455.7 |
Calculate Sum of Squares, the Linear Equation, the Pearson Correlation Coefficient and R^2.
Using the regression equation, estimate Streamflow for 2025 assuming Snowpack was 18.2.
Assignment:
- Complete the corrections exam or enjoy a pleasant weekend.


