Linear Regression Examples in Statistics
Start with the recap, study the fully worked examples, then use the practice problems to check your understanding of Linear Regression.
This page combines explanation, solved examples, and follow-up practice so you can move from recognition to confident problem-solving in Statistics.
Concept Recap
Linear regression is a statistical method for modeling the relationship between a dependent variable and one or more independent variables by fitting a straight line that minimizes the sum of squared distances from data points to the line (least squares method).
Given scattered points, draw the 'best' line through them. 'Best' means the line that's closest to all points on average. This line lets you predict Y from X.
Read the full concept explanation โHow to Use These Examples
- Read the first worked example with the solution open so the structure is clear.
- Try the practice problems before revealing each solution.
- Use the related concepts and background knowledge badges if you feel stuck.
What to Focus On
Core idea: Linear regression finds the line that minimizes total squared prediction errors (least squares). The slope tells you how much Y changes per unit increase in X.
Common stuck point: Students extrapolate regression lines far beyond the data range. Predictions outside the observed data are unreliable because the linear relationship may not hold.
Sense of Study hint: First, plot the data on a scatter plot to verify a linear pattern exists. Then use the least-squares formulas to find the slope and intercept of the best-fit line. Finally, check the residual plot for random scatter (no pattern) to confirm the linear model is appropriate.
Worked Examples
Example 1
hardSolution
- 1 Step 1: Slope = 1.8: for each additional hour studied, the predicted exam score increases by 1.8 points.
- 2 Step 2: Y-intercept = 2.5: when x = 0 (no studying), the predicted score is 2.5. This may or may not be meaningful in context.
- 3 Step 3: The equation predicts scores based on study hours, assuming a linear relationship.
Answer
Example 2
hardPractice Problems
Try these problems on your own first, then open the solution to compare your method.
Example 1
hardExample 2
hardRelated Concepts
Background Knowledge
These ideas may be useful before you work through the harder examples.