MATH 2 • STATISTICS & PROBABILITY

Comparing Model Fits — I can compare two models (linear vs quadratic) for a data set and justify which fits better conceptually.

Learn to choose between a line and a curve by examining residuals, R² values, and the real-world story behind the data.

Historical Context & Motivation

For centuries, scientists and mathematicians have tried to describe patterns in data using equations. The simplest approach — drawing a straight line — works remarkably well for many situations, but the real world doesn't always follow a straight path. A ball tossed into the air, the spread of a rumor through a school, or the braking distance of a car at different speeds all trace curves rather than lines. Recognizing when a line is adequate and when a curve is needed has been a driving question in statistics since its earliest days.

1805
Legendre & Least Squares
Adrien-Marie Legendre published the method of least squares, giving mathematicians a systematic way to fit a line to data by minimizing the sum of squared errors.
1809
Gauss Extends the Method
Carl Friedrich Gauss showed that least-squares fitting could be applied to curves and polynomials, not just straight lines, opening the door to quadratic regression and beyond.
1885
Galton & Regression
Francis Galton coined the term regression while studying heredity, formalizing the concept of fitting models to bivariate data.
1920s
R² Emerges
Statisticians developed the coefficient of determination (R²) as a standard measure for how well a model explains variation in data, making it possible to objectively compare competing models.
Today
Technology & Model Selection
Graphing calculators and software instantly compute multiple regressions and residual plots, allowing students and professionals to compare linear, quadratic, and other models in seconds.

The central question this lesson addresses is deceptively simple: given a set of data, should you model it with a line or a parabola, and how do you defend that choice? Answering this requires both mathematical tools (like R² and residual plots) and conceptual reasoning about what the data actually represents.

Core Principles & Definitions

Before you can compare two models, you need to understand the vocabulary and the key ideas behind model fitting. A model is simply an equation that attempts to describe the relationship between two variables. When we say a model "fits" data well, we mean its predicted values are consistently close to the actual data points. The following principles form the foundation of model comparison.

1

Linear Model

A linear model has the form y = ax + b. It predicts a constant rate of change — every time x increases by 1, y changes by the same amount a.
2

Quadratic Model

A quadratic model has the form y = ax² + bx + c. It captures situations where the rate of change itself is changing — the data curves up or down.
3

Residuals

A residual is the difference between an observed value and the value predicted by the model: residual = observed − predicted. Residuals tell you how far off the model is at each data point.
4

Residual Plot

A residual plot graphs residuals on the y-axis against x-values on the x-axis. A good fit shows residuals scattered randomly around zero; a pattern signals the model is missing something.
5

R² (Coefficient of Determination)

measures the proportion of variation in y that is explained by the model. It ranges from 0 to 1 — the closer to 1, the better the fit. Comparing R² values across models is one quick way to judge improvement.
KEY TAKEAWAY
Think of fitting a model like choosing shoes for a sport. A pair of basic sneakers (a linear model) works fine for walking, but if you need to play basketball (your data curves), you'll perform much better with basketball shoes (a quadratic model). The key is matching the tool to the task — and the residual plot is like trying them on to see which actually fits your feet.

Visual Explanation — Seeing the Difference

The most powerful way to understand model comparison is to look at the same data with two different models overlaid on it, and then examine the residual plots side by side. The diagram below shows a scatter plot of braking distance versus car speed. A linear fit is shown in blue, and a quadratic fit is shown in violet. Notice how the linear model systematically misses the data at low and high speeds.

The scatter plot shows braking distance (ft) versus speed (mph). The dashed blue line is the linear fit; the solid violet curve is the quadratic fit. Notice how the quadratic curve passes much closer to the data points, especially at low and high speeds where the linear model consistently overshoots or undershoots.

In the diagram above, the linear model appears to underpredict braking distance at both low and high speeds while overpredicting in the middle range. This U-shaped pattern of error is a classic sign that the relationship between the variables is curved, not straight. The quadratic model, by contrast, hugs the data much more tightly because it accounts for the increasing rate at which braking distance grows as speed rises.

Mathematical Framework

Two mathematical tools are essential for comparing model fits: the residual and the coefficient of determination (R²). Understanding how each is calculated will help you use them with confidence.

LINEAR MODEL
y = ax + b
a = slope (rate of change), b = y-intercept (starting value). This model assumes a constant rate of change.
QUADRATIC MODEL
y = ax² + bx + c
a = curvature coefficient (determines whether the parabola opens up or down), b = linear coefficient, c = y-intercept. This model allows the rate of change to increase or decrease over time.
RESIDUAL
eᵢ = yᵢ − ŷᵢ
eᵢ = residual for the i-th data point, yᵢ = observed (actual) value, ŷᵢ = predicted value from the model. A positive residual means the model underpredicted; a negative residual means it overpredicted.
COEFFICIENT OF DETERMINATION
R² = 1 − (SS_res / SS_tot)
SSres = sum of squared residuals = Σ(yᵢ − ŷᵢ)². SStot = total sum of squares = Σ(yᵢ − ȳ)². R² close to 1 means the model explains nearly all the variation in the data.
⚠️ Important Note on R²
A higher R² does not automatically mean a model is better. Adding more terms to a model will almost always increase R², even if the added complexity is not justified. That's why you should always check the residual plot and consider whether the model makes sense for the situation. R² is a useful number, but it's only one piece of the puzzle.

Residual Plots — The Deciding Factor

The single most important visual tool for comparing model fits is the residual plot. When a model fits the data well, its residuals should look like a random scatter of points above and below the horizontal line at zero — no pattern, no trend, no curve. When you see a clear pattern in the residual plot, it means your model is systematically missing something. The diagram below shows two residual plots for the same data: one from a linear model and one from a quadratic model.

Left: the residual plot for the linear model shows a clear U-shaped pattern — the model systematically under- and over-predicts. Right: the residual plot for the quadratic model shows points scattered randomly around zero — indicating a much better fit.

The left residual plot reveals a telltale U-shaped pattern: the residuals are positive at the ends and negative in the middle. This curved pattern is exactly what you expect when you force a straight line onto data that is actually curved. The quadratic residual plot on the right, by contrast, shows no systematic pattern — the points bounce above and below zero in an essentially random way, which is exactly what a well-fitting model should produce.

  • Pattern in residuals → The model is missing a feature of the data. Try a different model.
  • Random scatter in residuals → The model captures the main trend. The fit is appropriate.
  • Increasing spread (fan shape) → The model may fit the trend, but predictions become less reliable for larger x-values.

Worked Example — Choosing the Better Model

A physics class measures the height of a ball (in feet) at various times (in seconds) after it is launched upward. The data are shown below. Two regressions are computed: a linear model and a quadratic model. Let's walk through how to decide which model fits better.

Ball launch height data
Time (s)Height (ft)
04
0.520
1.028
1.530
2.024
2.512
3.00
Comparing Linear and Quadratic Models for Ball Height Data
1
Step 1 — Fit a Linear ModelUsing a calculator or regression tool, the linear model is y = −1.14x + 20.57. The R² value for this model is R² = 0.244. This means the line explains only about 24.4% of the variation in height.
Linear: y = −1.14x + 20.57, R² ≈ 0.244
2
Step 2 — Fit a Quadratic ModelThe quadratic model is y = −16x² + 40x + 4. The R² value is R² = 0.994. This means the parabola explains about 99.4% of the variation — a dramatic improvement.
Quadratic: y = −16x² + 40x + 4, R² ≈ 0.994
3
Step 3 — Examine the Residual PlotsThe linear residual plot shows a strong curved (inverted-U) pattern: positive residuals in the middle, negative at the ends. The quadratic residual plot shows residuals scattered close to zero with no discernible pattern. This confirms the quadratic model is capturing the trend that the linear model misses.
Linear residuals: curved pattern. Quadratic residuals: random scatter.
4
Step 4 — Apply Conceptual ReasoningPhysics tells us that the height of a projectile under gravity follows the equation h = −½gt² + v₀t + h₀, which is a quadratic function of time. The situation itself — an object launched upward and pulled back down by gravity — demands a model with a squared term. A straight line cannot capture the rise-then-fall behavior.
Context confirms: projectile motion is fundamentally quadratic.
5
Step 5 — State Your ConclusionThe quadratic model y = −16x² + 40x + 4 fits the data far better than the linear model. Evidence: R² jumps from 0.244 to 0.994, the residual plot becomes patternless, and the real-world context of projectile motion requires a quadratic relationship.
Conclusion: The quadratic model is the better fit — supported by R², residual analysis, and real-world reasoning.

Strengths & Limitations of Each Model Type

Neither the linear model nor the quadratic model is universally "better." Each has strengths in certain situations and weaknesses in others. The table below summarizes when to reach for each.

Comparison of linear and quadratic models
FeatureLinear ModelQuadratic Model
Shape of fitStraight lineParabola (U or inverted U)
Best when data shows…Constant rate of changeChanging rate of change (acceleration or deceleration)
Number of parameters2 (slope, intercept)3 (a, b, c)
Extrapolation riskModerate — continues in same directionHigh — parabola may curve wildly outside the data range
SimplicitySimple and easy to interpretSlightly more complex; vertex and direction matter
Common real-world examplesCost per item, hourly wages, temperature rising at a constant rateProjectile motion, profit optimization, braking distance
KEY TAKEAWAY
Think of the linear model as a ruler — great for measuring straight edges, but useless for tracing the curved rim of a bowl. The quadratic model is like a flexible curve tool that can bend to match the shape of the data. Always start with the simpler model (the ruler), and only switch to the curve if the residual plot tells you the straight edge isn't working. Simplicity is a virtue — don't use a quadratic model if a line already fits well.

Connection to Advanced Model Fitting

The skills you are building now — comparing two models using residuals, R², and conceptual reasoning — are the same skills used in advanced statistics and data science. In future courses, you will encounter exponential, logarithmic, and sinusoidal models, and you will use more sophisticated criteria to choose among them. The table below previews how the tools you know now extend into higher-level work.

Current tools vs advanced extensions
Concept NowAdvanced Version
R² to compare two modelsAdjusted R² — penalizes adding unnecessary parameters so you can fairly compare models with different numbers of terms
Residual plot (visual check)Formal residual diagnostics — statistical tests for normality, homoscedasticity, and independence of residuals
Linear vs quadraticMultiple regression, polynomial regression, and non-linear models (exponential, logistic, etc.)
Conceptual justificationModel selection criteria such as AIC and BIC, which balance fit quality with model complexity

The core philosophy never changes, no matter how advanced the statistics get: the best model is the simplest one that adequately captures the pattern in the data and makes sense in context. This idea is sometimes called the principle of parsimony, and it will guide your work in AP Statistics, college-level courses, and professional data analysis.

Practice Problems

PROBLEM 1CONCEPTUAL
A student fits a linear model to a data set and produces a residual plot that shows a clear U-shaped curve. What does this pattern suggest, and what should the student try next?
PROBLEM 2BASIC CALCULATION
A linear model gives R² = 0.72 and a quadratic model gives R² = 0.96 for the same data set. Which model explains more variation? By how many percentage points does the better model improve on the weaker one?
PROBLEM 3INTERMEDIATE
A data set of hours studied (x) versus test score (y) produces the following results: Linear model: y = 5.2x + 62, R² = 0.91, residual plot shows random scatter. Quadratic model: y = −0.1x² + 6.0x + 60, R² = 0.92, residual plot also shows random scatter. Which model would you choose and why?
PROBLEM 4APPLIED
A small business tracks monthly revenue (in thousands of dollars) over its first 8 months. Revenue starts low, grows quickly, then begins to level off. A linear model gives R² = 0.84 with a curved residual pattern. A quadratic model gives R² = 0.97 with random residuals. Explain which model is better and what the quadratic model tells the business owner about revenue growth.
PROBLEM 5CRITICAL THINKING
A researcher collects data on the relationship between temperature (°F) and the number of ice cream cones sold per day. She fits both a linear and a quadratic model. The quadratic model has a slightly higher R² (0.89 vs 0.87), but the linear residual plot shows random scatter. A colleague argues the quadratic model is better because it has a higher R². Write a reasoned response evaluating the colleague's claim.

Lesson Summary

When deciding between a linear model (y = ax + b) and a quadratic model (y = ax² + bx + c), use three complementary tools. First, compare R² values — the model with the higher R² explains more of the variation in the data. Second, examine the residual plots — a random scatter around zero signals a good fit, while a U-shaped or curved pattern signals the model is missing curvature in the data. Third, apply conceptual reasoning — ask whether the real-world situation logically involves a constant rate of change (linear) or a changing rate of change (quadratic).

Always start with the simpler linear model and only move to the quadratic model if the data, the residuals, and the context all point toward curvature. A tiny R² improvement with no residual pattern change does not justify added complexity. The guiding principle is parsimony — choose the simplest model that adequately captures the trend and makes sense in the real world.

Varsity Tutors • Math 2 • Comparing Model Fits — Linear vs Quadratic