Tutorials › Regression Analysis (Undergraduate) › Residual Clusters as Clues to Omitted Subgroups

Specification Checks and Residual Patterns · Tutorial 578 of 991

Residual Clusters as Clues to Omitted Subgroups

Learn to recognize residual clusters, calculate their groupwise pattern, and check whether a recorded subgroup or data-collection process could explain it.

Advanced 11 min read

What You'll Learn

  • Define a residual cluster as a distinct group of residuals with a different vertical level.
  • Calculate residuals from observed and fitted responses and summarize their levels by a candidate label.
  • Explain how an omitted group effect can produce separated residual levels.
  • Check whether groups overlap in predictor or fitted-value ranges before interpreting a pattern.
  • Investigate recorded classifications and data-collection processes without assuming the pattern proves a cause.
  • Distinguish a useful diagnostic clue from evidence sufficient to change a model.

Why Residual Clusters Deserve Attention

A residual plot can show more than curvature or a steadily changing spread. Sometimes the points appear in distinct clouds: one set is mostly above zero, another mostly below, even though the sets occupy similar ranges of fitted values or predictors. Such separated residual clusters are a clue that observations may differ in a way the fitted model does not represent.

A plausible explanation is an omitted subgroup: for example, measurements from different sites, categories, devices, or time periods may have different average responses after accounting for the predictors in the model. A cluster can also prompt a check of how observations were classified or collected. But a visual pattern does not identify its cause. It is a reason to investigate, not proof that a particular variable belongs in the model.

Definition: For observation \(i\), the residual is \(e_i=y_i-\hat{y}_i\), where \(y_i\) is the observed response and \(\hat{y}_i\) is the response fitted by the model. A residual cluster is a visually distinguishable set of observations whose residuals tend to occupy a different vertical level from those of another set. A candidate label, such as site or device, may help describe the sets, but the label does not by itself explain the pattern.

What a Difference in Residual Level Suggests

A positive residual means the observed response is above the model's fitted value; a negative residual means it is below. If observations with a particular label tend to have positive residuals while another label's observations tend to have negative residuals, the model may be systematically underpredicting one group and overpredicting the other.

The comparison is most informative when the clusters overlap in fitted values or in the predictor ranges being examined. If one group appears only at low fitted values and another only at high fitted values, the apparent split could instead reflect an inadequately represented trend over that range. Likewise, a changing vertical spread is not the same thing as a change in residual level. Use the plot's shape, the data labels, and the collection context together.

For a precise reference point, consider the usual regression model with a linear conditional mean:

$$ Y_i=\beta_0+\beta_1x_{i1}+\cdots+\beta_px_{ip}+\varepsilon_i. $$

Here \(Y_i\) is the response, the \(x\)'s are included predictors, and \(\varepsilon_i\) is the error. For the standard regression setting, the conditional mean assumption is \(E(\varepsilon_i\mid x_{i1},\ldots,x_{ip})=0\); errors are also commonly assumed independent with constant variance for standard inference. Normal errors are not needed to notice a visual cluster, and this tutorial does not use a significance test. Residual plots are diagnostic evidence about whether the mean structure or data description may be incomplete.

Why an Omitted Group Effect Can Create Clusters

Suppose the response depends on a binary group indicator \(G_i\), where \(G_i=0\) identifies one group and \(G_i=1\) the other. Imagine the actual conditional mean has a group offset \(\delta\):

$$ E(Y_i\mid x_i,G_i)=\beta_0+\beta_1x_i+\delta G_i. $$

If the fitted model includes \(x_i\) but leaves out \(G_i\), then it cannot assign separate mean levels to the groups. When the group is balanced across the predictor values, the pooled fitted line can follow the overall trend while sitting between the two group means. Residuals for one group then tend to be negative and for the other positive.

A short derivation makes the pattern clear in the especially simple case where the groups are balanced at each value of \(x\), and the true relationship has no other error. The pooled intercept absorbs the average group offset, \(\delta\bar{G}\), while the slope remains \(\beta_1\). The residual from the reduced fit is therefore:

$$ e_i =\left(\beta_0+\beta_1x_i+\delta G_i\right) -\left(\beta_0+\delta\bar{G}+\beta_1x_i\right) =\delta(G_i-\bar{G}). $$

Thus the two group levels differ by \(\delta\), even though the reduced model has only one fitted mean at each \(x\). In real data, errors and imbalance can blur this ideal pattern, and if group membership is associated with the predictors, the fitted slope may also change. The derivation explains why clusters can occur; it does not establish that a group effect is the explanation in a particular data set.

Worked Example: A Group Offset Hidden by a Pooled Line

Suppose a hypothetical data set has two categories, A and B, and records a quantitative predictor \(x\) and response \(y\). The fitted model includes only an intercept and \(x\). The data are:

Category\(x\)\(y\)
A19
A211
A313
A415
B115
B217
B319
B421

The overall means are \(\bar{x}=(1+2+3+4+1+2+3+4)/8=2.5\) and \(\bar{y}=(9+11+13+15+15+17+19+21)/8=15\). The pooled least-squares slope is \(2\): as \(x\) increases by 1, the responses in both categories increase by 2, and the categories are balanced at each \(x\). The intercept is \(15-2(2.5)=10\), so the fitted line is \(\hat{y}=10+2x\).

For an observation with \(x=1\), the fitted value is \(10+2(1)=12\). Category A has residual \(9-12=-3\), while category B has residual \(15-12=3\). The same calculation applies at every listed \(x\): category A has residuals \(-3,-3,-3,-3\), and category B has \(3,3,3,3\). The two categories occupy the same predictor range but lie at distinct residual levels.

This is consistent with an omitted category offset of 6 response units. It is not a causal conclusion about category membership: the next step would be to check what the category represents and whether the measurements and study context support this explanation.

A Practical Investigation

When a residual plot seems to contain separated clouds, investigate systematically. Begin with the plotted pattern, then use labels and records to assess possible explanations. Groupwise summaries can describe the pattern, but they do not replace examining how observations were obtained.

1
Confirm what is clustered.
Check whether the separation is mainly in residual level, rather than a curved trend, a change in vertical spread, or a few unusual points. Note which fitted-value or predictor ranges the clusters cover.
2
Find informative labels.
Mark observations by available classifications such as site, treatment category, device, operator, or collection period. Ask whether a label consistently distinguishes the positive- and negative-residual clouds.
3
Check overlap and balance.
Compare the groups' predictor ranges and fitted values. If the groups scarcely overlap, a group difference may be hard to separate from a trend over predictor values. A visual contrast based on non-overlapping ranges is less decisive.
4
Verify what the labels mean.
Consult the data definitions and collection records. Confirm that categories were recorded consistently and ask whether procedures, instruments, timing, or eligibility rules differed. A label can identify a collection process rather than a meaningful population subgroup.
5
State a provisional explanation.
Describe which observations tend to be above or below the fitted values and what recorded distinction may account for the split. Keep the explanation provisional until it is supported by the study context and further analysis.

Worked Example: Checking a Device-Related Cluster

Imagine a hypothetical laboratory records response \(y\) at \(x=0,1,2\), using two devices. A model fitted without a device term gives \(\hat{y}=5+1.5x\). At each \(x\), Device A's observed response is 2 units below the fitted value, while Device B's is 2 units above it.

At \(x=0\), \(\hat{y}=5+1.5(0)=5\). If the observed values are 3 for A and 7 for B, the residuals are \(3-5=-2\) and \(7-5=2\). At \(x=1\), \(\hat{y}=5+1.5(1)=6.5\); observed values of 4.5 and 8.5 again give \(-2\) and \(2\). At \(x=2\), \(\hat{y}=5+1.5(2)=8\); observed values of 6 and 10 again give \(-2\) and \(2\).

Both devices cover the same \(x\) range, and the residual level follows the device label in this hypothetical example. That pattern makes device calibration a reasonable question to investigate. It does not show, by itself, whether the cause is calibration, another difference between measurement procedures, or a feature of the hypothetical data. The device records and measurement protocol would be relevant evidence.

Summarizing the Pattern Without Overstating It

A useful descriptive summary is the mean residual within each candidate group. For a group \(g\) with \(n_g\) observations, calculate \(\bar{e}_g=\sum_{i\in g}e_i/n_g\). Also inspect the individual residuals and their ranges: a group mean can conceal substantial scatter or be driven by a small number of observations. Report the units as the units of the response, since residuals are measured on the response scale.

For example, if one group has mean residual \(+4.2\) points and another has mean residual \(-3.8\) points, the descriptive statement is that the model underpredicts the first group's observed responses by an average of 4.2 points and overpredicts the second group's by an average of 3.8 points in this sample. The summary does not say why the groups differ, whether the difference would persist in new data, or whether membership causes a response change.

In ordinary least squares with an intercept, the residuals across the full fitted data set sum to zero. Consequently, negative and positive residuals can balance even when a structured split is present. A zero overall mean residual is not evidence that every subgroup is well represented. Conversely, two residual clouds on opposite sides of zero are not automatically evidence of an omitted subgroup; the same visual balance can occur by chance or through another feature of the data.

Worked Example: A Cluster Is a Clue, Not a Diagnosis

Suppose a hypothetical residual plot contains six observations from each of two collection periods, with overlapping fitted values. The residuals in Period 1 are \(-5,-4,-3,-4,-5,-3\) response units; those in Period 2 are \(3,4,5,4,3,5\) response units.

The Period 1 mean is \((-5-4-3-4-5-3)/6=-24/6=-4\) units. The Period 2 mean is \((3+4+5+4+3+5)/6=24/6=4\) units. The difference between the group means is \(4-(-4)=8\) response units. The residuals are consistently lower in Period 1 and higher in Period 2 in this example.

The calculation describes a clear split, but it does not establish that collection period caused it. A careful investigation would check whether a protocol, instrument, staff assignment, or other relevant condition changed between periods, and whether the group labels are accurate. If no such distinction is found, the cluster remains an unexplained diagnostic feature rather than a confirmed subgroup effect.

Common Mistakes

  • Calling every split an omitted-group effect. The wrong reasoning is, “There are two clouds, so the model must be missing a category.” The correction is to check whether a recorded label actually tracks the clouds and whether the groups overlap in the relevant predictor ranges.
  • Treating a residual pattern as causal evidence. A device or site label may align with residual levels without causing the difference. Describe the association and investigate the collection context; do not claim a causal effect from the plot alone.
  • Ignoring how the observations were collected. The same plotted pattern could reflect a real subgroup difference or a difference in measurement or recording procedures. Check definitions and records before assigning a substantive explanation.
  • Using the overall residual average to dismiss the pattern. In a least-squares fit with an intercept, the full-sample residuals sum to zero. That fact does not rule out systematically positive residuals in one group and negative residuals in another.
Key takeaway: Separated residual clusters show that the fitted model leaves different groups of observations at different response levels. Use labels, predictor-range overlap, and data-collection records to investigate the pattern, but treat any proposed explanation as a hypothesis to assess rather than a conclusion from the plot alone.

Check Your Understanding

Try these questions before moving on.

  1. An observation has \(y_i=28\) and \(\hat{y}_i=31\). Calculate its residual and interpret the sign in context.
  2. Why is a residual split more informative when the candidate groups overlap in fitted-value or predictor ranges?
  3. A model's residuals are mostly positive for one clinic and mostly negative for another. Give two distinct features of the study or collection process you would investigate before attributing the pattern to a clinic effect.
  4. Why does an overall residual mean of zero not rule out separated residual clusters?
  5. What can groupwise mean residuals describe, and what can they not establish on their own?