Linear Regression Equations and Application

Learning Objectives

Why This Matters

Every time Zillow estimates a home price, every time a sports analytics team projects next season's wins, every time a hiring manager benchmarks a salary offer against years of experience, a regression equation connects what's known to what's predicted. Linear regression is the foundational model behind machine learning, real estate valuation, and salary benchmarking -- the same y = mx + b from algebra, now powered by data instead of textbook coordinates. Master this equation and you understand the engine running most of modern prediction.

How to Use This Simulation

  1. Drag any data point on the scatter plot and watch the regression equation recalculate in real time.
  2. Toggle "Show Your Line" to adjust your own slope and intercept, then compare your line against the computed regression line.
  3. Switch between preset datasets to see how different patterns produce different regression equations.
  4. Check the Explanation Panel below -- it updates as you interact and tells you what the equation means.
Slope (b)
--
Intercept (a)
--
Regression Equation
--

What's Happening

Quick Check

A fitness tracker company finds that the regression equation relating daily steps (in thousands) to calories burned is ŷ = 1200 + 85x. For a user who walked 8,000 steps (x = 8), the equation predicts ŷ = 1,880 calories. Their actual calories burned were 1,950. Which interpretation is correct?

Try This

Load the "Temperature vs Ice Cream Sales" preset. The simulation displays the regression equation ŷ = a + bx with computed values. (1) Write the equation by hand in the form ŷ = a + bx using the slope and intercept shown. (2) Use it to predict ice cream sales on a 75°F day. (3) Check your prediction against the scatter plot -- does your predicted point fall on the regression line? Verify using the simulation.

Load the "Car Age vs Resale Value" preset. (1) Describe the pattern in one sentence (direction, strength, linearity). (2) Before looking at the equation, predict whether the slope is positive, negative, or near zero. (3) Read the slope and intercept from the simulation and write the equation. (4) Use the equation to predict the resale value of a 6-year-old car. (5) Now drag the 10-year-old car's data point up to $20,000. How did the slope change, and why does a single point have that much influence on the equation?

Load the "Sunlight vs Plant Height" preset. The regression equation computes, but the scatter plot shows a curved pattern. (1) Write the regression equation. (2) Use it to predict plant height at 18 hours of sunlight. (3) Explain in two sentences why this prediction is likely to be wrong, referencing the pattern visible in the scatter plot. (4) Would you recommend using this regression equation to advise a greenhouse manager on optimal sunlight hours? Defend your answer using evidence from the scatter plot.

Instructor Notes

Teaching Notes

Start by having students try the manual-fit sliders before showing the computed regression line. Most students' eyeballed lines will have a similar slope but a different intercept. The surprise when the computed line appears -- sometimes noticeably different from their guess -- is the entry point for why "best fit" needs a mathematical definition, not intuition.

The draggable-point interaction is most effective when you ask: "Predict what happens to the slope if I drag this point straight up." Most students predict the slope increases. Sometimes it decreases (if the point is near x̄). That surprise teaches that every point's influence depends on its x-position, not just its y-value.

Common Student Errors

Discussion Questions

Exam Connection

Typical exam questions provide a table of (x, y) values and ask students to compute the regression equation using the formulas. The simulation directly practices reading slope and intercept from data. Some exams give the equation and ask for a prediction at a specific x value -- the Starter tier challenge practices this exact format.