STAT101 - Introduction to Probability Theory and Statistics
Scatter plots, correlation, least squares regression, r², significance tests, prediction intervals, and the mistakes that get points taken off exams
Every chapter before this one asked "is there a difference between groups?" Chapter 14 asks a completely different question: "how are two numeric variables related, and can I use one to predict the other?" This is the foundation of everything from "does studying more raise your GPA?" to "does mileage predict CO2 emissions?" The textbook (Groebner, Shannon & Fry, Business Statistics, 10th Global Ed., Ch. 14) builds this up in two layers:
| # | You should be able to… |
|---|---|
| 1 | Calculate and interpret the correlation between two variables. |
| 2 | Determine whether the correlation is significant. |
| 3 | Calculate the simple linear regression equation and know its assumptions. |
| 4 | Determine whether a regression model is significant. |
| 5 | Recognize regression analysis applications for description and prediction. |
| 6 | Calculate and interpret confidence intervals for the regression analysis. |
| 7 | Recognize potential problems if regression analysis is used incorrectly. |
To keep every formula grounded, this page carries one dataset through the entire chapter — the textbook's own "Midwest Distribution Company" example: a marketing director wants to know whether years with the company (x) is related to annual sales, in $ thousands (y), for a random sample of 12 sales reps. Every formula below is demonstrated on this exact data, and the numbers match the Excel regression output shown in the slides — so you can check your own hand calculations against it.
| Rep | x = Years with Company | y = Sales ($000) |
|---|---|---|
| 1 | 3 | 487 |
| 2 | 5 | 445 |
| 3 | 2 | 272 |
| 4 | 8 | 641 |
| 5 | 2 | 187 |
| 6 | 6 | 440 |
| 7 | 7 | 346 |
| 8 | 1 | 238 |
| 9 | 4 | 312 |
| 10 | 2 | 269 |
| 11 | 9 | 655 |
| 12 | 6 | 563 |
A quick look at a scatter plot of this data shows the points drifting up and to the right — sales tend to be higher for reps who have been with the company longer. That visual pattern is exactly what correlation and regression will let us quantify.
A two-dimensional plot showing the joint occurrence of two quantitative variables — one variable on the x-axis, one on the y-axis, one dot per observation. Also called a scatter diagram. It is always the first thing you do before calculating anything, because it tells you whether a straight-line model even makes sense.
A quantitative measure of the strength and direction of the linear relationship between two variables.
| Pattern | What it looks like | What r tells you |
|---|---|---|
| Linear (positive) | Points trend up and to the right in a fairly straight band | r is a large positive number, e.g. 0.7–1.0 |
| Linear (negative) | Points trend down and to the right in a fairly straight band | r is a large negative number, e.g. -0.7 to -1.0 |
| Curvilinear | Points bend into a curve (U-shape, S-shape, etc.) | r can be small or even near 0, even though a strong nonlinear relationship exists! |
| No relationship | Points scattered with no visible pattern | r near 0 |
Not necessarily! r only measures linear association. Two variables can have a very strong curved relationship (like the "curvilinear" scatter plots above) and still produce a small r, because a straight line is simply the wrong shape to draw through them. Always look at the scatter plot first — don't just trust the number.
Deviation form (Equation 14.1):
Algebraic (raw-score) form — easier for calculators:
where: r = sample correlation coefficient, n = sample size, x = independent variable, y = dependent variable.
First, find the means: x̄ = Σx / n = 55 / 12 = 4.583, ȳ = Σy / n = 4,855 / 12 = 404.583
| y | x | x - x̄ | y - ȳ | (x-x̄)(y-ȳ) | (x-x̄)² | (y-ȳ)² |
|---|---|---|---|---|---|---|
| 487 | 3 | -1.58 | 82.42 | -130.22 | 2.50 | 6,793.06 |
| 445 | 5 | 0.42 | 40.42 | 16.98 | 0.18 | 1,633.78 |
| 272 | 2 | -2.58 | -132.58 | 342.06 | 6.66 | 17,577.46 |
| 641 | 8 | 3.42 | 236.42 | 808.56 | 11.70 | 55,894.42 |
| 187 | 2 | -2.58 | -217.58 | 561.36 | 6.66 | 47,341.06 |
| 440 | 6 | 1.42 | 35.42 | 50.30 | 2.02 | 1,254.58 |
| 346 | 7 | 2.42 | -58.58 | -141.76 | 5.86 | 3,431.62 |
| 238 | 1 | -3.58 | -166.58 | 596.36 | 12.82 | 27,748.90 |
| 312 | 4 | -0.58 | -92.58 | 53.70 | 0.34 | 8,571.06 |
| 269 | 2 | -2.58 | -135.58 | 349.80 | 6.66 | 18,381.94 |
| 655 | 9 | 4.42 | 250.42 | 1,106.86 | 19.54 | 62,710.18 |
| 563 | 6 | 1.42 | 158.42 | 224.96 | 2.02 | 25,096.90 |
| Σ = 4,855 | Σ = 55 | Σ = 3,838.92 | Σ = 76.92 | Σ = 276,434.92 |
Plug into Equation 14.1:
Interpretation: r = 0.8325 is close to +1.0, so there is a strong, positive linear relationship between years with the company and sales — reps who have been there longer tend to sell substantially more.
A correlation computed from a sample could just be sampling noise. The significance test asks: "is the population correlation ρ really different from zero, or could our sample r have happened by chance even if ρ = 0?"
Assumptions: data are interval/ratio level, and (x, y) come from a bivariate normal distribution.
H₀: ρ = 0 vs. Hᴸ: ρ ≠ 0, α = 0.05, df = 12 - 2 = 10, so critical values are ±t0.025,10 = ±2.228
Decision: Because 4.752 > 2.228, we reject H₀. Conclusion: there is a statistically significant positive linear relationship between years with the company and sales volume.
Notice this t-value (4.752) is the same number you'll get later when testing whether the regression slope b₁ is significant. In simple (one-variable) regression, testing "is r significant?" and testing "is the slope significant?" are mathematically the same test, just written with different symbols. If your two answers don't match, you made an arithmetic error somewhere.
Simple regression analysis: only one dependent variable (y) and one independent variable (x). Simple linear regression: the relationship between them is modeled as a straight line.
Population model:
Estimated (sample) regression equation:
ý = predicted value of y for a given x | b₁ = estimate of the true slope β₁ | b₀ = estimate of the true y-intercept β₀
| Coefficient | What it means |
|---|---|
| Slope, b₁ | The average change in the dependent variable (y) for a one-unit increase in the independent variable (x). |
| Intercept, b₀ | The predicted value of y when x = 0 — only meaningful if x = 0 is actually a realistic/observed value in your data. |
The sign of b₁ always matches the sign of r — if the correlation is positive, the slope is positive, and vice versa. That's a fast way to sanity-check your algebra. Then always ask: "does this slope's real-world direction make sense?" A slope showing that studying less improves your grade should make you suspect a data or calculation error, not report it as fact.
Residual: the difference between an actual y value and the value the regression line predicts, y - ý. Some residuals are positive (line underestimates), some negative (line overestimates). The least squares criterion finds the one line that minimizes the sum of the squared residuals — squaring stops positive and negative errors from canceling out and penalizes big misses much more than small ones.
The least squares equations:
The slides literally demonstrate trying three candidate lines by trial and error on the Midwest data: ý=450+0x gave Σ(y-ý)²=301,187; ý=250+40x gave 102,307; ý=150+60x gave 97,667. Better and better — but you'd never know when to stop guessing! The least squares formulas above find the exact minimum directly (SSE = 84,834.29 for this data), no guessing required.
Using the same 12 reps, first tally the four building-block sums:
| Σx | Σy | Σxy | Σx² | n |
|---|---|---|---|---|
| 55 | 4,855 | 26,091 | 329 | 12 |
Step 1 — Slope:
Step 2 — Intercept:
Step 3 — The regression equation:
Interpretation of b₁ = 49.91: for every additional year a rep stays with the company, average annual sales are predicted to rise by about $49,910.
Interpretation of b₀ = 175.83: a brand-new rep (0 years with the company) is predicted to start at about $175,830 in sales — but be careful, x = 0 is outside our observed range of 1–9 years (see the extrapolation warning later on this page).
Step 4 — Predict a new value. For a rep with x = 10 years:
(This matches, up to rounding, the Excel regression output shown in the slides: ý = 175.8288 + 49.9101x.)
Se measures the typical size of a prediction error — how far, on average, actual y values fall from the regression line. Smaller Se = tighter, more trustworthy predictions.
For the Midwest data: SSE = 84,834.29, n - 2 = 10, so Se = √8,483.43 = 92.1055 (thousand $).
For our data: Sb1 = 92.1055 ÷ √76.92 = 92.1055 ÷ 8.770 = 10.5021
Hypotheses: H₀: β₁ = 0 (x does not help predict y) vs. HA: β₁ ≠ 0
Critical values: ±t0.025,10 = ±2.228. Because 4.752 > 2.228, reject H₀. The p-value from Excel is 0.0008, which is less than α/2 = 0.025, confirming the same conclusion: the true slope is not zero, so years with the company is genuinely useful for explaining sales volume.
SST (Total Sum of Squares) = Σ(y - ȳ)²
— total variation in y.
SSR (Sum of Squares Regression) = variation in y explained by the regression line.
SSE (Sum of Squares Error) = variation in y left unexplained (the residuals).
For the Midwest data: SST = 276,434.92, SSE = 84,834.29, so SSR = 276,434.92 - 84,834.29 = 191,600.62.
r² is the proportion of the total variation in y that is explained by its linear relationship with x. For simple (one-x) regression, r² is simply r squared.
For our data: R² = 191,600.62 ÷ 276,434.92 = 0.6931 (matches 0.8325² = 0.6931 ✓)
Interpretation: about 69.3% of the variation in sales among these reps is explained by how long they've been with the company; the remaining 30.7% is due to other factors (skill, territory, luck, etc.).
r² close to 1.0 → the line fits the data very tightly, strong explanatory power. r² close to 0.0 → the line barely explains anything about y. There's no universal "good" cutoff — 0.3 might be impressive in social science data, unimpressive in engineering data — so always interpret r² in the context of the field.
H₀: ρ² = 0 (x explains none of y's variation) vs. HA: ρ² > 0
For our data: F = 191,600.62 ÷ 8,483.43 = 22.59. Since F = 22.59 > Fcritical,0.05 = 4.965 (and p-value = 0.0008 < 0.05), reject H₀ — the model is significant.
In simple linear regression, the significance test on r, the t-test on the slope b₁, and the F-test on R² are three different-looking roads to the exact same conclusion. (In fact t² = F here: 4.752² = 22.58 ≈ 22.59.) If an exam question gives you any one of these test results, you already know what the other two would say.
Regression output: ý = 703.39 - 13.64(mpg). H₀: β₁ = 0 vs. HA: β₁ ≠ 0, α = 0.05. Since p-value = 0.0000 < 0.025, reject H₀.
Confidence interval for the slope: b₁ ± t0.05,df=56 Sb1 gives a 95% CI of (-14.72, -12.56). Interpretation: with 95% confidence, for each 1 mpg increase, mean CO2 emission changes between -14.72 and -12.56 grams, point estimate -13.64 grams. Because the whole interval is negative, we're confident the true relationship really is negative — not just an artifact of this sample.
Regression output: ý = 527.61 + 1,352.80(days). Relevant range of x: 1 to 16 days.
Point predictions: for x = 5 days, ý = 527.61 + 1,352.80(5) = $7,291.59. For x = 9 days, ý = 527.61 + 1,352.80(9) = $12,702.81.
Excel/XLSTAT output for xp = 5 days: point estimate $7,291.59; 95% confidence interval for the mean bill at 5 days, ($6,789.63, $7,793.54); 95% prediction interval for one individual patient's bill at 5 days, ($1,545.01, $13,038.16).
Both are centered on the same point estimate ý, but they answer different questions:
Notice above: the CI for the average bill at 5 days is a tight $6,790–$7,794, but the PI for one specific patient's bill is a much wider $1,545–$13,038. If a question asks about "the average" use CI; if it asks about "a particular / one" observation, use PI.
Confidence interval for the mean value of y at xp:
Prediction interval for one individual y at xp:
Notice the "+1" is the only difference — that's what makes the prediction interval wider.
Recall: ý = 674.93, Se = 92.1055, n = 12, x̄ = 4.583, Σ(x-x̄)² = 76.92, t0.025,10 = 2.228.
(xp - x̄)² = (10 - 4.583)² = 29.34
95% Confidence interval (mean sales for all reps at 10 years):
95% Prediction interval (one specific rep's sales at 10 years):
As expected, the prediction interval is noticeably wider than the confidence interval.
Our sample only contains reps with 1–9 years of tenure. Predicting at xp = 10 (like we just did above) is already a small step outside the observed x-range — called extrapolation. We have zero data confirming the relationship stays linear beyond x = 9, so this prediction carries extra, unquantified risk. Predicting sales for, say, a 25-year veteran using this same equation would be far worse: the line might curve, plateau, or reverse entirely outside the range we actually observed. Never trust a regression prediction far outside the range of x used to build the model.
A strong, significant r just means x and y move together. It never proves x causes y — a third, unmeasured "lurking" variable could be driving both. (Classic example: ice cream sales and drowning deaths correlate strongly — because both rise in summer heat, not because ice cream causes drowning.)
Using the regression equation to predict y for x values far outside the range of x actually observed in the sample. The straight-line relationship is only verified within the observed range.
If the scatter plot clearly bends, a straight line is the wrong model — even a "significant" linear fit can badly misrepresent the true (curved) relationship and produce systematically wrong predictions in different regions of x.
A high r² from a tiny sample (say n = 5) is far less reliable than the same r² from a large sample — one or two unusual points can swing it dramatically. Always check the sample size and look for influential outliers before trusting the fit.
A single extreme (x, y) point far from the rest of the data can pull the entire regression line toward it, distorting both the slope and r². Always inspect the scatter plot for points that sit noticeably apart from the main cluster before reporting your regression results.
1. A correlation coefficient of r = -0.91 indicates:
2. Which of the following is true about the least squares method?
3. In the regression equation ý = 175.83 + 49.91x from the Midwest example, what does b₁ = 49.91 mean?
4. A regression's r² = 0.20 means:
5. Which statement correctly distinguishes a confidence interval from a prediction interval in regression?
6. A scatter plot shows a clear U-shaped (curvilinear) pattern, but the computed r = 0.05. What should you conclude?
7. Using a regression equation built on x-values ranging from 1 to 9 to predict y at x = 50 is an example of:
8. If a regression's slope t-test gives t = 4.75 with df = 10 at α = 0.05 (two-tailed critical value 2.228), the correct decision is:
9. (Short Answer) A sample of n = 8 has Σx = 40, Σy = 200, Σxy = 1,100, Σx² = 220. Compute the slope b₁.
Answer:
10. (Short Answer) Using the same data as Question 9 (n = 8, x̄ = 5, ȳ = 25, b₁ = 5.0), find the intercept b₀ and the full regression equation.
Answer:
Regression equation: ý = 0 + 5.0x, i.e. ý = 5.0x
11. (Short Answer) For the Midwest Distribution data (r = 0.8325, n = 12), calculate r² and explain in one sentence what it means about sales.
Answer:
About 69.3% of the variation in sales among these reps is explained by how many years they've been with the company; the remaining 30.7% is explained by other factors not in this model.
Correlation coefficient:
Significance test for correlation:
Regression equation:
Least squares slope and intercept:
Standard error of the estimate:
Standard error of the slope:
Slope significance test:
Confidence interval for the slope:
Sums of squares:
Coefficient of determination:
F-test for the coefficient of determination:
Point prediction:
Confidence interval for mean y at xp:
Prediction interval for individual y at xp:
| Term | Definition |
|---|---|
| Scatter plot | A two-dimensional plot showing the joint occurrence of two quantitative variables; used to visually assess the relationship between them. |
| Correlation coefficient (r) | A quantitative measure, ranging from -1.0 to +1.0, of the strength and direction of the linear relationship between two variables. |
| Dependent variable (y) | The variable whose values are thought to depend on, or be predicted by, another variable; plotted on the vertical axis. |
| Independent variable (x) | The variable thought to influence or explain the dependent variable; also called the explanatory variable; plotted on the horizontal axis. |
| Least squares method | The technique that finds the regression line minimizing the sum of the squared differences between actual and predicted y values. |
| Regression equation | The estimated straight-line equation, ý = b₀ + b₁x, used to describe or predict the dependent variable from the independent variable. |
| Slope (b₁) | The average change in the dependent variable for each one-unit increase in the independent variable. |
| Y-intercept (b₀) | The predicted value of the dependent variable when the independent variable equals zero. |
| Coefficient of determination (r²) | The proportion of the total variation in the dependent variable that is explained by its linear relationship with the independent variable. |
| Residual | The difference between an actual observed value of y and the value predicted by the regression model (y - ý). |
| Extrapolation | Using a regression equation to predict y for values of x that fall outside the range of x actually observed in the sample data. |
| Homoscedasticity | The assumption that the variance of the regression errors is constant (equal) across all levels of the independent variable. |