Introduction to Regression
Learn how to find the best-fitting line through data points and make predictions using linear regression.
Definition
- is the slope (how steep the line is)
- is the y-intercept (where the line crosses the y-axis)
- is the input variable (independent variable)
- is the predicted output (dependent variable)
Try it now
Worked Examples
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 →
Identify the y-intercept
When hours, the score is 50 points →
Write the equation
Substitute and into →
Answer: The regression equation is , where is hours studied and is the predicted test score.
Common Mistakes
Confusing the order of subtraction in the slope formula
Why it's wrong: Using instead of gives the reciprocal of the correct slope.
Correct: Remember: slope is 'rise over run' - the change in (vertical) divided by the change in (horizontal).
Extrapolating too far beyond the data
Why it's wrong: 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 values much larger or smaller than your original data points.
Assuming correlation means causation
Why it's wrong: 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.
Interactive Visual
Linear Function Explorer
| x | y |
|---|---|
| -2 | -2 |
| -1 | -1 |
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
Interactive Sandbox
Interactive Grapher
Try these examples:
y = 2x + 1
m=2, b=1
Expression Calculator
Try these:
History
No calculations yet
Practice Problems
16 problemsWhat does the represent in the equation ?
Why It Matters
- Business: Predicting sales based on advertising spending
- Medicine: Estimating drug dosage based on patient weight
- Economics: Forecasting GDP growth from various indicators
- Sports: Projecting athlete performance from training metrics
- Science: Modeling relationships between variables in experiments
Real World Applications
Predicting House Prices
Real estate analysts use regression to estimate home values based on factors like square footage, number of bedrooms, and location.
Example:
If homes sell for approximately 150 dollars per square foot with a base price of 50000 dollars, the equation might be , where is square footage.
A real estate model shows: , where is square feet and is price in dollars.
What is the predicted price for a 1500 square foot home?
Step 1: Write the mathematical expression
Substitute into the equation:
Fuel Efficiency Analysis
Automotive engineers use regression to understand how car weight affects fuel consumption.
Example:
Data might show that fuel efficiency decreases by 0.005 km/L for every kilogram of additional weight.
A car model shows: , where is weight in kg and is fuel efficiency in km/L.
What efficiency is predicted for a car weighing 1200 kg?
Step 1: Write the mathematical expression
Calculate:
Key Takeaways
- 1Linear regression finds the straight line that best fits a set of data points
- 2The regression equation is , where is the slope and is the y-intercept
- 3Slope is calculated as (rise over run)
- 4Once you have the equation, you can make predictions by substituting values for
- 5Regression shows correlation, but correlation does not imply causation
Frequently Asked Questions
Glossary
- Linear regression
- A statistical method for finding the best-fitting straight line through data points
- Line of best fit
- The straight line that minimizes the distance between itself and all data points
- Slope
- The steepness of the line, representing the rate of change ( in )
- Y-intercept
- The point where the line crosses the y-axis ( in )
- Prediction
- Using the regression equation to estimate for a given value of
- Independent variable
- The input variable () that we use to make predictions
- Dependent variable
- The output variable () that we are trying to predict