Why the Origin Is a Special Choice
A regression line summarizes how a quantitative response \(y\) changes with a quantitative predictor \(x\). The ordinary least-squares line has the form \(\hat{y}=b_0+b_1x\): it estimates both an intercept \(b_0\) and a slope \(b_1\). A line forced through the origin instead has the form \(\hat{y}=b_1x\), so its intercept is fixed at zero.
That constraint may look like a harmless simplification. But it makes a substantive claim: when \(x=0\), the fitted response must be zero. This is appropriate only when that claim makes sense for the situation and the way the variables are measured. A response can still be positive at \(x=0\), for example, if there is a fixed starting amount, fee, or baseline.
For paired observations \((x_i,y_i)\), the ordinary least-squares line minimizes \(\sum_{i=1}^{n}(y_i-b_0-b_1x_i)^2\) over choices of both coefficients. The zero-intercept line minimizes \(\sum_{i=1}^{n}(y_i-b_1x_i)^2\) over choices of slope alone. These definitions describe how the coefficients are calculated; they do not by themselves establish that a linear model is a good description of a broader population.
To calculate either fit, the data must consist of paired quantitative measurements, with \(x\) treated as the predictor and \(y\) as the response. Least squares selects coefficients to minimize squared response errors. No probability model is needed just to perform this calculation. If the goal is statistical inference beyond the observed data, additional assumptions would be needed.
How the Two Fits Are Calculated
For the ordinary line, the slope is based on how \(x\) and \(y\) vary together around their sample means, and the intercept is then chosen so the fitted line is positioned appropriately. Using the course notation, the formulas are:
The zero-intercept slope uses a different calculation because it must fit the data without shifting the line up or down:
The slopes need not be equal. The ordinary fit estimates a baseline response as well as a rate of change; the zero-intercept fit cannot estimate a baseline separately, so its slope must account for any systematic offset in the observed responses.
Why Ordinary Least Squares Estimates an Intercept
A short minimization argument shows why the ordinary fit does not generally put its intercept at zero. For a fixed slope \(b_1\), the sum of squared errors is \(S(b_0)=\sum_{i=1}^{n}(y_i-b_0-b_1x_i)^2\). Its derivative with respect to \(b_0\) is \(-2\sum_{i=1}^{n}(y_i-b_0-b_1x_i)\). At the minimizing intercept, this derivative is zero, so the residuals sum to zero:
Thus the intercept is selected to suit the observed data rather than assumed in advance. It equals zero only when the fitted slope and the sample means happen to satisfy \(\bar{y}=b_1\bar{x}\). If theory or measurement justifies requiring the line through \((0,0)\), that is a different, constrained fitting problem—not the default ordinary least-squares problem.
Worked Example: A Fixed Setup Fee
Suppose, hypothetically, a service charges a fixed setup fee of $5 plus $2 per item processed. For three jobs, the observed numbers of items \(x\) and total charges \(y\) are \((1,7)\), \((2,9)\), and \((3,11)\). Find and compare the ordinary fit and the zero-intercept fit. Here, \(x\) is measured in items and \(y\) in dollars.
Ordinary fit. The sample means are \(\bar{x}=2\) items and \(\bar{y}=9\) dollars. The slope is
The intercept is \(b_0=9-(2)(2)=5\) dollars. The fitted equation is \(\hat{y}=5+2x\). It predicts charges of $7, $9, and $11 for these three jobs, exactly matching the hypothetical observations.
Zero-intercept fit. Its slope is
The constrained equation is \(\hat{y}=4.143x\). Its predictions at \(x=1,2,3\) are approximately $4.143, $8.286, and $12.429. The sum of squared errors is
The ordinary fit captures the setup fee in its intercept, leaving the slope to represent the per-item charge. The constrained fit cannot represent a $5 charge at zero items, so it tilts the line to compromise across the observations. Since zero items would still incur the setup fee in this scenario, forcing the fitted charge to be zero at \(x=0\) is not appropriate.
Comparing the Fits on the Same Data
The following example shows that even when the response increases with the predictor, the two choices can produce different predictions. It also makes clear that ordinary least squares minimizes the total squared errors for the data used to fit the line.
Worked Example: Comparing Two Fitted Equations
Consider hypothetical paired measurements of study time \(x\), in hours, and quiz score \(y\), in points: \((1,4)\), \((2,5)\), \((3,7)\), and \((4,8)\). Calculate both lines and compare their predictions at 4 hours.
The means are \(\bar{x}=2.5\) hours and \(\bar{y}=6\) points. For the ordinary fit, the centered cross-products sum to 7 and the squared \(x\)-deviations sum to 5. Therefore,
The ordinary fitted equation is \(\hat{y}=2.5+1.4x\). At 4 hours, it predicts \(2.5+(1.4)(4)=8.1\) points. At the four observed \(x\)-values, its fitted values are 3.9, 5.3, 6.7, and 8.1 points. The corresponding observed-minus-fitted differences are \(0.1,-0.3,0.3,-0.1\) points, giving a sum of squared errors of \(0.01+0.09+0.09+0.01=0.20\) points squared.
For the zero-intercept fit, \(\sum x_i y_i=67\) and \(\sum x_i^2=30\), so
This equation predicts \(2.233(4)\approx8.933\) points at 4 hours. Its fitted values at \(x=1,2,3,4\) are about 2.233, 4.467, 6.700, and 8.933 points. The squared errors sum to approximately
For these observed data, the ordinary line has the smaller sum of squared errors. But the calculation alone does not show whether study time has a causal effect on quiz scores, or whether a score of zero at zero study hours is scientifically impossible. Those are questions about context and study design, not just the fitting arithmetic.
When a Zero Intercept Can Make Sense
A zero-intercept fit can be reasonable when there is a strong substantive or measurement-based reason for the response to be zero whenever the predictor is zero. For example, a hypothetical sensor calibrated to measure added mass might be expected to report zero added mass when no mass is applied. Even then, the exact relationship might be affected by measurement error or other features of the instrument. The constraint should be justified, not adopted merely because a line looks simpler without an intercept.
Worked Example: A Calibration That Is Near the Origin
Suppose a hypothetical instrument is tested at four applied masses \(x\), in kilograms, and gives readings \(y\), in units: \((0,0)\), \((1,2.1)\), \((2,3.9)\), and \((3,6.2)\). Compare the two fits. The zero reading at zero applied mass makes a zero-intercept constraint plausible in this setup, though it does not by itself prove that the constraint is correct for all measurements.
For the ordinary fit, \(\bar{x}=1.5\) kilograms and \(\bar{y}=3.05\) units. The centered cross-products sum to 10.2 and the squared \(x\)-deviations sum to 5. Thus,
The ordinary equation is \(\hat{y}=-0.01+2.04x\). Its fitted values are \(-0.01,2.03,4.07,6.11\) units, giving squared errors that sum to \(0.0420\) units squared.
For the constrained fit, \(\sum x_i y_i=28.5\) and \(\sum x_i^2=14\), so \(b_1=28.5/14\approx2.036\) units per kilogram. Its fitted values are approximately \(0,2.036,4.071,6.107\) units, and its squared errors sum to approximately \(0.04214\) units squared. The two fits are very similar here, in part because the ordinary intercept is close to zero. This is a comparison for these four observations, not proof that the intercept is exactly zero in a larger measurement process.
The intercept is the line's predicted response at \(x=0\). That interpretation may be useful even if zero is outside the observed predictor range, but a prediction there may then be an extrapolation rather than a prediction supported by nearby data. The earlier material on extrapolation explains why predictions beyond the observed range require particular caution.
What Least Squares Guarantees—and What It Does Not
The ordinary model includes every line available to the zero-intercept model: setting \(b_0=0\) in the ordinary equation produces a zero-intercept line. Therefore, the minimum possible sum of squared errors for the ordinary fit cannot be greater than the minimum for the constrained fit:
This is a mathematical guarantee about the fitting data and the squared-error criterion. It does not mean the ordinary fit must be the better scientific model in every situation. A justified zero-intercept constraint may reflect known measurement or physical structure; and a smaller fitting error alone does not establish that one line will predict new observations more accurately. Nor does least squares guarantee that every individual prediction from the ordinary line is closer to its observed response than the corresponding prediction from the constrained line.
Common Mistake
A related error is to treat the ordinary intercept as proof that the response truly has that value at zero predictor. The intercept is a fitted value implied by the chosen line. If zero is far from the observed \(x\)-values, its contextual interpretation may depend on extrapolation.
Check Your Understanding
Use the definitions and comparisons in this tutorial to answer the following questions.
- In a model of total delivery cost \(y\) versus distance \(x\), what does a zero-intercept constraint claim about the predicted cost at zero distance?
- For a zero-intercept least-squares fit, the data have \(\sum x_i y_i=48\) and \(\sum x_i^2=16\). What is the fitted slope, including its calculation?
- Why can the ordinary least-squares slope differ from the slope of a zero-intercept fit?
- Is the ordinary fit's sum of squared errors guaranteed to be less than or equal to the zero-intercept fit's sum for the fitting data? Explain using the sets of lines each fit considers.
- A fitted ordinary line has a nonzero intercept. Does that alone prove the true response at \(x=0\) is nonzero? Explain the distinction.