Introduction to Regression
Finding the Slope
A study shows that for every additional hour of studying, test scores increase by 5 points. If a student who studies 0 hours scores 50 points, what is the regression equation?
Identify the slope: Score increases by 5 points per hour of studying = $m = 5$
Identify the y-intercept: When $x = 0$ hours, the score is 50 points = $b = 50$
Write the equation: Substitute $m = 5$ and $b = 50$ into $y = mx + b$ = $y = 5x + 50$
Answer: The regression equation is $y = 5x + 50$, where $x$ is hours studied and $y$ is the predicted test score.
Making a Prediction
Using the equation $y = 5x + 50$, predict the test score for a student who studies for 6 hours.
Identify the known values: Equation: $y = 5x + 50$, and $x = 6$ hours = Ready to substitute
Substitute $x = 6$: $y = 5(6) + 50$ = $y = 30 + 50$
Calculate the result: $y = 30 + 50 = 80$ = $y = 80$ points
Answer: A student who studies for 6 hours is predicted to score 80 points.
Calculating Slope from Two Points
Given two data points $(2, 8)$ and $(5, 17)$, find the slope of the line connecting them.
Recall the slope formula: $m = \frac{y_2 - y_1}{x_2 - x_1}$ = Formula ready
Identify coordinates: $(x_1, y_1) = (2, 8)$ and $(x_2, y_2) = (5, 17)$ = Values identified
Substitute into the formula: $m = \frac{17 - 8}{5 - 2} = \frac{9}{3}$ = $m = 3$
Answer: The slope is $m = 3$, meaning $y$ increases by 3 for every 1 unit increase in $x$.
Finding the Complete Equation
Using the slope $m = 3$ from the previous example and the point $(2, 8)$, find the y-intercept and write the full equation.
Use point-slope form: Substitute $m = 3$, $x = 2$, $y = 8$ into $y = mx + b$ = $8 = 3(2) + b$
Solve for $b$: $8 = 6 + b$, so $b = 8 - 6$ = $b = 2$
Write the equation: Substitute $m = 3$ and $b = 2$ = $y = 3x + 2$
Answer: The regression equation is $y = 3x + 2$.
Mistake: Confusing the order of subtraction in the slope formula
Why: Using $\frac{x_2 - x_1}{y_2 - y_1}$ instead of $\frac{y_2 - y_1}{x_2 - x_1}$ gives the reciprocal of the correct slope.
Correct: Remember: slope is 'rise over run' - the change in $y$ (vertical) divided by the change in $x$ (horizontal).
Mistake: Extrapolating too far beyond the data
Why: The regression line is only reliable within the range of your data. Predicting far outside this range can lead to unrealistic results.
Correct: Be cautious about predictions for $x$ values much larger or smaller than your original data points.
Mistake: Assuming correlation means causation
Why: Just because two variables are related (correlated) does not mean one causes the other.
Correct: Regression shows relationships, but additional analysis is needed to establish causation.
Predicting House Prices
Real estate analysts use regression to estimate home values based on factors like square footage, number of bedrooms, and location.
If homes sell for approximately 150 dollars per square foot with a base price of 50000 dollars, the equation might be $y = 150x + 50000$, where $x$ is square footage.
Fuel Efficiency Analysis
Automotive engineers use regression to understand how car weight affects fuel consumption.
Data might show that fuel efficiency decreases by 0.005 km/L for every kilogram of additional weight.
Linear regression finds the straight line that best fits a set of data points
The regression equation is $y = mx + b$, where $m$ is the slope and $b$ is the y-intercept
Slope is calculated as $m = \frac{y_2 - y_1}{x_2 - x_1}$ (rise over run)
Once you have the equation, you can make predictions by substituting values for $x$
Regression shows correlation, but correlation does not imply causation
Q: What if my data points do not fall exactly on a line?
A: Real data rarely falls perfectly on a line. The regression line minimizes the total squared distance from all points to the line. Some points will be above the line, some below - this is normal!
Q: How do I know if my regression line is a good fit?
A: The $R^2$ value (coefficient of determination) measures how well the line fits. It ranges from 0 to 1 - higher values mean better fit. You will learn more about this in the lesson on correlation.
Q: Can regression be used for non-linear relationships?
A: Linear regression only works for straight-line relationships. For curved relationships, you need polynomial regression or other advanced methods.
Introduction to Regression
1 / 12
Introduction to Regression
Learn how to find the best-fitting line through data points and make predictions using linear regression.