



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Equations • Residuals • Solved Examples | Study Notes for Statistics Students
Linear regression is a statistical method that models the relationship between two numerical variables using a straight line. It lets us predict the value of one variable based on the value of another. Why it's useful: Regression turns a general trend into a precise, usable equation — instead of just knowing two variables are related, we can estimate an actual predicted value. Real-world applications: Predicting house prices from square footage, estimating sales from advertising spend, forecasting exam scores from hours studied, and estimating crop yield from rainfall.
Regression always involves two roles: one variable is used to make the prediction, and the other is the value being predicted. Term Also Called Example
Independent variable (x) Predictor variable Hours studied
Dependent variable (y) Response variable Exam score
In short: x is the input we already know; y (or ŷ) is the output we are trying to predict or explain. The independent variable is plotted on the horizontal axis, and the dependent variable on the vertical axis.
3. The Linear Regression Equation Linear regression fits a straight line through the data using this equation: ŷ = a + bx Symbol Meaning
ŷ (y-hat) The predicted value of the dependent variable
a The intercept — predicted value of ŷ when x = 0
b The slope — change in ŷ for each 1-unit increase in x
x The independent variable (the known input)
4. Understanding the Slope The slope (b) tells us how much ŷ changes for every 1-unit increase in x — it controls both the direction and the steepness of the line.
Slope Meaning
Positive (b > 0) ŷ increases as x increases
Negative (b < 0) ŷ decreases as x increases
Zero (b ≈ 0) x has little or no effect on ŷ
5. Understanding the Intercept The intercept (a) is the predicted value of ŷ when x = 0. It anchors the regression line on the y-axis. When it has practical meaning: If x = 0 is a realistic, observable situation (e.g. 0 hours of studying), the intercept can be meaningfully interpreted. When it may not make sense: If x = 0 falls far outside the range of the observed data, or is not physically possible (e.g. a house with 0 square feet), the intercept is just a mathematical anchor point, not a real-world prediction. Quick example: In ŷ = 10 + 2.5x (x = hours studied), the intercept a = 10 makes sense — it's the predicted score for a student who studies 0 hours, a realistic scenario.
9. Correlation and Regression
Aspect Correlation Regression
Purpose Measures strength & direction of a relationship Models the relationship to make predictions
Output A single number, r An equation, ŷ = a + bx
Prediction Cannot make predictions Can predict ŷ for a given x
Variables No distinction between variables Distinguishes independent (x) / dependent (y)
Interpretation Sign and size show direction & strength Slope & intercept describe the relationship precisely
10. Coefficient of Determination (r²) r² (r-squared) tells us the percentage of variation in y that is explained by x. It ranges from 0 to 1 (or 0% to 100%). Example: If r² = 0.81, then 81% of the variation in y is explained by x through the regression line; the remaining 19% is due to other factors or random variation. A higher r² means a better-fitting model. 11. Solved Examples
Given: ŷ = 10 + 2.5x (x = hours studied, ŷ = predicted quiz score). Predict the score for x = 6 hours. Formula: ŷ = a + bx. Substitution: ŷ = 10 + 2.5(6). Calculation: ŷ = 10 + 15 = 25. Interpretation: A student who studies 6 hours is predicted to score 25 on the quiz.
Given: The student from Example 1 (x = 6) actually scored y = 29. Predicted ŷ = 25. Formula: Residual = y − ŷ. Substitution: Residual = 29 − 25. Calculation: Residual = +. Interpretation: The actual score was 4 points higher than the model predicted (a positive residual).
Given: ŷ = 10 + 2.5x, with r² = 0.81. Slope (b = 2.5): Each extra hour of studying is associated with a 2.5-point increase in predicted quiz score. Intercept (a = 10): A student who studies 0 hours is predicted to score 10. r² = 0.81: 81% of the variation in quiz scores is explained by hours studied.
A regression equation for advertising spend (x, $1000s) and sales (ŷ, $1000s) is ŷ = 5 + 3x. Predict sales for x = 4, then find the residual if actual sales were y = 20. Step 1: ŷ = 5 + 3(4) = 5 + 12 = 17 (predicted sales = $17,000). Step 2: Residual = y − ŷ = 20 − 17 = +3 — actual sales were $3,000 higher than predicted.
12. Common Student Mistakes - Confusing correlation with regression: Correlation (r) measures strength; regression gives an equation for predicting values. - Predicting far outside the observed data range (extrapolation) — regression equations are only reliable within the range of x used to build them. - Ignoring residual patterns: A curved or funnel-shaped residual plot means a straight line may not be the best model. - Misinterpreting the slope: The slope describes an association , not automatically a cause-and-effect relationship. - Misinterpreting the intercept: It is not always practically meaningful, especially when x = 0 is unrealistic. - Confusing r with r²: r shows direction and strength (−1 to +1); r² shows percentage of variation explained (0 to 1). 13. Exam Tips & Quick Revision Summary
Concept Key Point
Regression equation ŷ = a + bx
Residual Residual = y − ŷ
Meaning of slope (b) Change in ŷ for each 1-unit increase in x
Meaning of intercept (a) Predicted ŷ when x = 0
Meaning of r² % of variation in y explained by x
x y ŷ a b r r² Independent variable Actual value Predicted value Intercept Slope Correlation coefficient
Variation explained