Tutorials › Regression Analysis (Undergraduate) › Valid Extreme Cases and Data Errors

Leverage and Influential Observations · Tutorial 565 of 991

Valid Extreme Cases and Data Errors

Learn to verify unusual observations, correct confirmed data errors transparently, and retain valid extreme cases unless the study’s eligibility rules give a sound reason to exclude them.

Intermediate 10 min read

What You'll Learn

  • Distinguish a statistical flag from evidence that a record is wrong.
  • Check unusual observations against original records, units, identifiers, and collection procedures.
  • Correct confirmed data errors while preserving an audit trail.
  • Explain why a valid extreme case can strongly affect a fitted regression.
  • Decide when exclusion follows from the study target and when it merely changes the analysis.
  • Report how conclusions change when a valid case is included or omitted.

Why an Unusual Case Needs Investigation, Not Automatic Deletion

A regression diagnostic can identify a case that has an unusual predictor value, a large residual, or a strong effect on the fitted coefficients. That is a reason to look more carefully at the record; it is not evidence by itself that the record is wrong. The distinction matters because deleting a genuine observation can change what population the analysis describes and can conceal important variation.

The first task is therefore to establish whether the recorded values accurately represent an eligible observational unit. Only after checking the record should an analyst decide how it belongs in the analysis. Statistical influence describes what happens to a fitted model when a case is included; it does not determine whether the case is valid.

Definition: A data error is a recorded value or record that fails to represent the intended observation accurately—for example, because of a transcription mistake, incorrect unit, coding error, or accidental duplicate. A valid extreme case is an eligible observation whose values are unusual but have been verified as accurately recorded.

The Model and the Role of Influence

For context, consider simple linear regression with predictor \(X\) and response \(Y\). The working model is \(Y_i=\beta_0+\beta_1x_i+\varepsilon_i\), where \(\beta_0\) is the intercept, \(\beta_1\) is the slope, and \(\varepsilon_i\) represents variation not explained by the linear mean. The ordinary least squares (OLS) fit chooses the intercept and slope to minimize the sum of squared residuals.

A regression interpretation relies on assumptions appropriate to the question. The conditional mean should be adequately represented by the chosen linear form, observations should correspond to distinct and appropriately sampled observational units, and the conditional errors should have mean zero. Standard-error-based inference additionally relies on appropriate error-variance assumptions; exact small-sample \(t\) procedures also use a normal-error assumption. These assumptions are not guaranteed by fitting a line or by checking whether a record is valid. In particular, a handful of points cannot establish that a linear model is adequate.

The calculations below compare OLS slopes to show how records affect a fit. The calculations themselves are algebraic; they do not establish a causal relationship or justify statistical inference. In each example, treat the line as a working summary and do not infer that its assumptions have been verified merely because a slope can be calculated.

Key distinction: A case can be influential and valid, or influential because it contains an error. The diagnostic describes sensitivity of the fit; record verification and study eligibility determine whether the observation is accurate and belongs in the analysis.

Why Extreme Values Can Change a Regression Fit

In simple regression, the OLS slope can be written as the ratio of the cross-product of centered predictor and response values to the centered predictor sum of squares. This expression helps explain why an unusual case may matter: a point far from the predictor mean can contribute strongly to both the numerator and denominator.

$$ \hat{\beta}_1 = \frac{\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y})} {\sum_{i=1}^{n}(x_i-\bar{x})^2} $$

This formula follows by minimizing the squared residuals. For any fixed slope \(b_1\), the minimizing intercept is \(b_0=\bar{y}-b_1\bar{x}\), so fitted residuals can be written as \((y_i-\bar{y})-b_1(x_i-\bar{x})\). Differentiating the sum of their squares with respect to \(b_1\), setting the derivative to zero, and solving gives the displayed expression, provided the predictor values are not all identical.

$$ \frac{d}{db_1}\sum_{i=1}^{n}\left[(y_i-\bar{y})-b_1(x_i-\bar{x})\right]^2 = -2\sum_{i=1}^{n}(x_i-\bar{x})(y_i-\bar{y}) +2b_1\sum_{i=1}^{n}(x_i-\bar{x})^2 $$

An extreme \(x_i\) can be far from \(\bar{x}\), giving it substantial leverage in the calculation. If its response also differs from what the rest of the data would suggest, the fitted line may move noticeably. This explains why influence prompts investigation, but the equation contains no information about whether the observation was recorded correctly.

Worked Example: Correcting a Verified Transcription Error

Suppose a hypothetical dataset records predictor \(x\) and response \(y\) for five eligible, distinct cases. Four records are \((1,2)\), \((2,3)\), \((3,3)\), and \((4,4)\). The fifth is recorded as \((10,120)\). An analyst checks the original measurement sheet and confirms that the fifth response was \(12\), not \(120\). The value \(120\) was a transcription error; it was not rejected because it made the regression look unusual.

Using the erroneous entry, the sums are \(\sum x_i=20\), \(\sum y_i=132\), \(\sum x_i^2=130\), and \(\sum x_iy_i=1233\). Thus \(\bar{x}=20/5=4\) and \(\bar{y}=132/5=26.4\). The slope is

$$ \hat{\beta}_1 = \frac{1233-5(4)(26.4)}{130-5(4^2)} = \frac{705}{50} = 14.1 $$

After correcting the record from the verified source, \(\sum y_i=24\) and \(\sum x_iy_i=153\), while the \(x\)-sums are unchanged. Now \(\bar{x}=4\) and \(\bar{y}=24/5=4.8\), so

$$ \hat{\beta}_1 = \frac{153-5(4)(4.8)}{130-5(4^2)} = \frac{57}{50} = 1.14 $$

The two slopes differ greatly, but the size of that difference is not the reason to correct the value. The original source verifies the error. The analyst should retain the original recorded value in an audit trail, document the correction and its source, and calculate the final analysis using the corrected value. These five points alone do not verify the linear-model assumptions or support a substantive conclusion about a population slope.

How to Investigate a Flagged Observation

A useful investigation separates data quality, study eligibility, and statistical influence. Begin with the record and the collection process rather than with a preferred regression result. Depending on the study, checks may include the original form or instrument file, units and permitted ranges, the case identifier, coding rules, data-import steps, and whether values from different individuals were joined incorrectly.

A surprising value is not automatically impossible. A value outside a typical range might be a genuine rare event; a value inside a plausible range might still have been attached to the wrong person. Compare the observation with independent records or source material when possible. Do not use agreement with the fitted line as the standard for deciding whether the measurement is true.

1
Identify the reason for the flag.
Record whether the case was flagged for an unusual predictor, residual, or change in the fitted model. This describes the statistical signal, not its cause.
2
Verify the record.
Check the original source, identifiers, units, codes, and collection or entry process. Seek evidence independent of whether the point fits the current regression.
3
Check eligibility.
Ask whether this observational unit belongs to the population and analysis specified by the study design. Apply the same inclusion rules to all cases.
4
Choose and document the analysis.
Correct a confirmed error using verifiable information. Retain a valid eligible case in the primary analysis, and explain any additional sensitivity analysis or design-based exclusion.

If the source cannot resolve a questionable value, do not label it a confirmed error. Document the uncertainty and use a defensible analysis plan, such as reporting sensitivity to plausible alternatives when that is appropriate. A missing or uncertain value is not permission to substitute whatever value would make the fitted model more convenient.

Worked Example: Retaining a Verified Extreme Case

Suppose the hypothetical records in the first example are checked and the last case is verified as \((10,12)\). All five cases meet the study’s inclusion criteria. The \(x=10\) value is far from the other predictor values, but it is a valid observation. For the five cases, \(\sum x_i=20\), \(\sum y_i=24\), \(\sum x_i^2=130\), and \(\sum x_iy_i=153\), giving \(\bar{x}=4\) and \(\bar{y}=4.8\). The fitted slope is

$$ \hat{\beta}_{1,\text{all}} = \frac{153-5(4)(4.8)}{130-5(4^2)} = \frac{57}{50} = 1.14 $$

If the valid case is omitted, the remaining four records have \(\sum x_i=10\), \(\sum y_i=12\), \(\sum x_i^2=30\), and \(\sum x_iy_i=33\). Therefore \(\bar{x}=2.5\), \(\bar{y}=3\), and

$$ \hat{\beta}_{1,\text{without case}} = \frac{33-4(2.5)(3)}{30-4(2.5^2)} = \frac{3}{5} = 0.600 $$

The slope changes by \(1.14-0.600=0.540\) response units per predictor unit. This shows that the case affects the fitted slope in this dataset; it does not show that the case is erroneous or should be removed. Because the example has only five observations, it also cannot establish that either fitted line adequately represents the conditional mean. If the scientific target includes all five eligible cases, deleting the verified case solely to reduce its influence would change the analysis without a data-quality or design-based justification.

Exclusion, Duplicates, and the Target Population

A valid observation can sometimes be excluded from a particular analysis for a reason fixed by the study design. For example, a study may target a defined age range, location, or treatment group. A verified case outside that scope is not a data error; it is simply not part of that analysis’s target population. That decision should follow the stated eligibility rule, not a post hoc wish to make the regression less sensitive.

A duplicate deserves similar care. Two records that look identical may be an accidental copy, but they may also represent two different people who happen to share the recorded values. Check identifiers and source records before removing either. A mistaken duplicate gives that case extra weight in OLS, while removing a genuine second case discards valid information.

Worked Example: Checking a Suspected Duplicate

Return to the five verified cases \((1,2)\), \((2,3)\), \((3,3)\), \((4,4)\), and \((10,12)\). A data import produces a sixth row that exactly repeats \((10,12)\). Suppose an identifier check confirms that the extra row is an accidental copy of the same person, not a second eligible participant.

With the duplicate included, the six rows have \(\sum x_i=30\), \(\sum y_i=36\), \(\sum x_i^2=230\), and \(\sum x_iy_i=273\). Hence \(\bar{x}=5\), \(\bar{y}=6\), and the slope is

$$ \hat{\beta}_{1,\text{with duplicate}} = \frac{273-6(5)(6)}{230-6(5^2)} = \frac{93}{80} = 1.1625 $$

Removing the confirmed copy restores the five-case slope \(1.14\), calculated above. The difference is \(1.1625-1.14=0.0225\) response units per predictor unit. Even though this particular numerical change is small, the duplicate should be removed because the identifier check shows that it is not a second observational unit. Conversely, if the sixth row belonged to a different eligible person with the same recorded values, removing it merely because it repeats another row would be unjustified.

Why Deleting Valid Cases Can Distort the Analysis

The fitted regression summarizes the cases and target population represented in the analysis. Removing a valid, eligible observation because it pulls the slope away from a preferred result can alter that summary and hide genuine behavior at the edge of the predictor range. It can also make the remaining cases look more consistent with the model than the full eligible data actually are.

Deleting cases selectively after seeing their influence is especially difficult to defend: the rule depends on the result it is being used to change. If the primary analysis excludes a valid case, the reason should come from a prespecified design rule or a clearly justified scientific scope, not from the fact that the case is inconvenient. A sensitivity analysis that compares the full-data fit with a fit omitting a verified case can be informative, provided it is labelled as a sensitivity analysis and the full-data result is not silently replaced.

Common pitfall: “The slope changes a lot when this case is removed, so it must be bad data.” Influence is not evidence of error. Verify the observation against source information, apply the study’s inclusion rules, and retain an accurate, eligible case in the primary analysis even when it has a substantial effect on the fit.
Key takeaway: Correct errors because they are demonstrably errors; exclude valid cases only when a defensible study-design or scientific-scope reason applies. A change in influence is a feature to understand and report, not a stand-alone deletion rule.

Check Your Understanding

Use the distinction between accuracy, eligibility, and influence to answer these questions.

  1. A flagged response is far from the fitted line. What evidence would justify calling its value a data error?
  2. A source form confirms a transposed digit. What should be documented when correcting the value?
  3. A verified, eligible case changes the fitted slope substantially when omitted. Does that change alone justify deletion? Explain.
  4. Two identical rows appear in a file. What should be checked before deciding whether one is a duplicate error?
  5. Give a reason a valid case might be excluded from one analysis without claiming that it was recorded incorrectly.