Tutorials › Regression Analysis (Undergraduate) › The Intercept as the Reference-Group Mean

Coding Categorical Predictors · Tutorial 297 of 991

The Intercept as the Reference-Group Mean

See how zero-coding identifies the reference category’s fitted mean and how to interpret the intercept in the outcome’s units.

Beginner 9 min read

What You'll Learn

  • Identify the category represented by an indicator value of zero.
  • Distinguish the model intercept from an observed outcome and a population mean.
  • Explain why the fitted intercept equals the reference group’s sample mean.
  • Calculate and interpret the intercept in the outcome’s units.
  • Check when this interpretation applies and recognize its limits.

Why the Intercept Has a Group Interpretation

A regression intercept is sometimes introduced as the fitted outcome when predictors equal zero. With a two-level categorical predictor coded using an indicator, zero is not an arbitrary numerical value: it marks one of the categories. That makes the intercept directly meaningful. In a regression containing only this factor, the intercept is the fitted mean outcome for the category coded zero.

This interpretation depends on the model and the coding. The intercept refers to the reference category selected by the indicator, not automatically to a particular group such as a control group. Nor is it an individual person’s outcome. It is a model-based mean, estimated from the observations in the zero-coded category.

Definition: Let \(x_i\) be an indicator for a two-level factor, with \(x_i=0\) for the reference category and \(x_i=1\) for the other category. In a regression containing only this factor, the model is \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\). If the model’s conditional mean is correctly specified, so that \(E(\varepsilon_i\mid x_i)=0\), then \(\beta_0\) is the population mean outcome for the category coded zero. The fitted intercept \(\hat{\beta}_0\) estimates that mean.

The symbol \(Y_i\) denotes the outcome for observation \(i\), and \(\varepsilon_i\) is that observation’s error from its model mean. The indicator changes according to category; in this model there are no other predictors. The reference category is the category assigned \(x_i=0\). If the outcome is measured in points, dollars, or milligrams per litre, the intercept has those same units.

From the Model to the Fitted Intercept

When \(x_i=0\), the model’s fitted value is \(\hat{\beta}_0+\hat{\beta}_1(0)=\hat{\beta}_0\). Thus the intercept is the fitted outcome for every observation in the reference category. Least squares chooses the intercept and the other coefficient to make the sum of squared residuals as small as possible. For this particular model, that fitting process makes the intercept equal to the observed sample mean in the reference category.

Result: If \(n_0\) observations are coded \(x_i=0\), and their outcomes have sample mean \(\bar{y}_0\), then ordinary least squares gives \(\hat{\beta}_0=\bar{y}_0\), provided the model includes an intercept and the reference category is observed. The fitted intercept is an estimate of the category’s mean outcome; it is not necessarily equal to the unknown population mean.

This result is a consequence of the model’s structure, not a special feature of a particular outcome. A model with an intercept and a two-level factor can assign a fitted mean to each category. For the zero-coded category, the fitted mean is the intercept. Least squares places that fitted mean at the sample mean of the outcomes in that category.

Why the Least-Squares Intercept Equals the Reference-Group Mean

To see the result, divide the observations into those with \(x_i=0\) and those with \(x_i=1\). Write \(n_0\) and \(n_1\) for the two group sizes. For a proposed pair of coefficients, the fitted value is \(\beta_0\) in the first category and \(\beta_0+\beta_1\) in the second. The residual sum of squares can therefore be written as

$$ SSE=\sum_{i:x_i=0}(y_i-\beta_0)^2+ \sum_{i:x_i=1}\bigl(y_i-(\beta_0+\beta_1)\bigr)^2. $$

Set \(m_0=\beta_0\) and \(m_1=\beta_0+\beta_1\). Any pair of fitted category means \(m_0,m_1\) can be represented by coefficients \(\beta_0=m_0\) and \(\beta_1=m_1-m_0\). Consequently, minimizing the residual sum of squares over the coefficients is equivalent to minimizing each group’s squared deviations from its own fitted mean. The part of the sum for the zero-coded group is minimized at that group’s sample mean:

$$ \frac{\partial}{\partial m_0} \sum_{i:x_i=0}(y_i-m_0)^2 =-2\sum_{i:x_i=0}(y_i-m_0)=0 \quad\Longrightarrow\quad m_0=\frac{1}{n_0}\sum_{i:x_i=0}y_i=\bar{y}_0. $$

Because \(m_0=\beta_0\), the least-squares intercept is \(\hat{\beta}_0=\bar{y}_0\). The zero-coded category must have observations for its sample mean to be calculated. For a model that estimates both category means, both categories must be represented in the data.

Worked Examples

Worked Example: Quiz Scores With a Zero-Coded Reference Category

Suppose a hypothetical class records quiz scores for students using an indicator \(x\): students who used a study guide are coded 1, and students who did not use one are coded 0. The scores for the zero-coded students are 72, 80, 76, and 84 points. The regression includes only this indicator and an intercept. What does the fitted intercept estimate, and what is its value?

The model is \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\). The reference category is students who did not use the guide. Its observed mean score is

$$ \bar{y}_0=\frac{72+80+76+84}{4} =\frac{312}{4}=78.0\text{ points}. $$

Therefore, \(\hat{\beta}_0=\bar{y}_0=78.0\) points. The fitted intercept estimates the mean quiz score for students who did not use a study guide. It is not the score of every such student; their observed scores vary around their group mean.

Assumptions and scope. The indicator is coded 0 for the stated reference category, the model includes an intercept and no other predictors, and the reference category has four observations. The example treats the observations as independent and uses a model in which the conditional mean for each category is represented by its category mean. These are stipulated modeling conditions; the four scores alone cannot establish independence or prove the model appropriate. No causal conclusion about study guides follows from this regression description.

Worked Example: A Reference Mean in a Clinical Measurement

In a hypothetical dataset, a two-level factor records whether a measurement was taken before or after a procedure. Before is coded 0 and after is coded 1. The outcome is a concentration measured in milligrams per litre. The three recorded before-procedure values are 4.2, 5.1, and 4.7. Find and interpret the fitted intercept in a regression containing only the indicator and an intercept.

The indicator sets the fitted value for the before category to the intercept. Calculate the mean of the zero-coded observations:

$$ \bar{y}_0=\frac{4.2+5.1+4.7}{3} =\frac{14.0}{3}=4.667\text{ mg/L}. $$

Thus, \(\hat{\beta}_0=4.667\) mg/L. It estimates the mean concentration for the before-procedure category in the population represented by the model. The units are mg/L because the outcome is measured in mg/L.

Assumptions and scope. The coding is stated explicitly, the before category is observed, and the model contains no predictor other than the indicator. For the interpretation as a population mean, assume the model errors have conditional mean zero within each category. Independence of observations is also assumed for the sampling context. The mean calculation itself is an arithmetic description of these hypothetical observations; it does not by itself verify those assumptions or support a claim that the procedure changes concentration.

Worked Example: Interpreting an Intercept in Its Own Units

A hypothetical program dataset records a two-level attendance category. Regular attendance is coded 0, and irregular attendance is coded 1. The outcome is a follow-up assessment score in points. For the five observations coded 0, the total of the recorded scores is 425 points. A regression includes only the attendance indicator and an intercept. Find the intercept estimate and state what it represents.

The sample mean for the reference category is its total divided by its sample size:

$$ \bar{y}_0=\frac{425}{5}=85.0\text{ points}. $$

The least-squares intercept is therefore \(\hat{\beta}_0=85.0\) points. It is the fitted mean follow-up score for the regular-attendance category, which has been coded zero. It is not the overall mean across both attendance categories, and it is not a guarantee that any particular person’s score will be 85 points.

Assumptions and scope. The stated coding identifies regular attendance as the reference category, five observations belong to that category, and the specified model has only the indicator and an intercept. The interpretation as an estimate of a population mean relies on a suitable conditional-mean model; the data are hypothetical and provide no independent evidence that the observations are representative or independent. The calculation is about a fitted mean, not an effect of attendance.

What the Interpretation Does—and Does Not—Say

The distinction between a fitted mean and a population mean matters. The coefficient \(\beta_0\) in the model describes the population conditional mean for the zero-coded category, under the model assumptions. The estimate \(\hat{\beta}_0\) is calculated from sample data. It equals the sample mean for that category in this model, but sampling variation means it may differ from the population mean.

The intercept is also tied to the coding choice. If a different category were assigned zero, the reference category—and therefore the direct interpretation of the intercept—would change. The key step when interpreting an intercept is to read the indicator definition rather than guess what zero means.

This result applies to a regression containing only the two-level factor and an intercept. When other predictors are included, the intercept need not equal the raw sample mean of the reference category: its interpretation depends on the values assigned to those other predictors. Keep the model specification in view whenever you interpret an intercept.

Finally, a fitted group mean describes an association in the data and model. By itself it does not show that category membership caused the outcome to take that value. A causal interpretation requires an appropriate study design and additional reasoning.

A Common Mistake

Common mistake: “The intercept is the overall average outcome because the regression line starts at zero.” This is not generally correct. In a model containing only a two-level factor coded 0 and 1, the intercept is the fitted mean for the category coded 0. It equals that category’s sample mean, not the mean across both categories. First identify which category has indicator value zero, then interpret the intercept as its fitted mean outcome, in the outcome’s units.

For a quick check, ask three questions: What is the outcome and its unit? Which category is coded zero? Does the model contain only this factor and an intercept? If the answers identify a two-level indicator-only model, the fitted intercept is the fitted mean outcome for the zero-coded reference category.

Check Your Understanding

Use the indicator coding and model specification in each question.

  1. A two-level factor is coded 0 for evening classes and 1 for morning classes. In a regression with only this factor and an intercept, which category’s fitted mean does the intercept represent?
  2. The three outcomes in the zero-coded category are 10, 14, and 12 units. Calculate the fitted intercept and state its units.
  3. In the indicator-only model, why does the least-squares intercept equal the sample mean outcome for observations coded zero?
  4. A researcher says the intercept is the overall sample mean. Explain why this claim is not justified just from the model specification.
  5. What changes about the interpretation if the zero-coded category is changed while the model still contains only the two-level factor and an intercept?