Who Is Included in a Complete-Case Regression?
A regression data set may contain records with some values missing. A common response is complete-case analysis: fit the regression using only records with observed values for the outcome and every predictor in the specified model. This rule is simple to apply, but it defines an analysis sample that may be smaller—and different in its composition and predictor ranges—than the original set of records.
The key phrase is “in the specified model.” A record is not automatically excluded just because some value is missing somewhere in the data table. For the regression under consideration, check the outcome and all predictors being used. If any one of those values is missing for a record, that record is not a complete case for that regression.
“Observed” means that a usable value is recorded, not that the value equals zero. A recorded zero can be a valid value; a blank, a designated missing-value code, or another indication that the value was not obtained is missing. The meaning of special codes must be checked before applying the complete-case rule. This tutorial assumes that missingness has been identified correctly.
The rule applies to the variables in the particular regression. If a table contains a missing value for a variable not used in the model, that alone does not make the record incomplete for that model. Conversely, missingness in the outcome is enough to exclude a record, even if all predictors are observed: there is no recorded outcome to use in fitting that regression.
Counting the Retained Records
A reliable way to count complete cases is to make a record-level indicator. For record \(i\), set \(I_i=1\) if the outcome and every included predictor are observed, and set \(I_i=0\) otherwise. Adding these indicators counts exactly the records that meet the rule.
This expression is a short justification of the count: each complete record contributes one to the sum, and each incomplete record contributes zero. It also makes an important practical point clear. The total number of records in the original data is \(n\), while the number used in the regression is \(n_{\text{CC}}\). They are equal only if every record is complete for the model.
Worked Example: Counting Complete Cases in Eight Records
Suppose a hypothetical data set contains eight records. The planned regression uses outcome \(Y\) and predictors \(X_1\) and \(X_2\). A dash marks a missing value.
| Record | \(Y\) | \(X_1\) | \(X_2\) |
|---|---|---|---|
| 1 | 12 | 2 | 10 |
| 2 | 15 | 4 | — |
| 3 | — | 6 | 14 |
| 4 | 18 | 8 | 20 |
| 5 | 19 | — | 22 |
| 6 | 21 | 12 | — |
| 7 | 22 | 14 | — |
| 8 | 24 | 16 | 30 |
Record 1 has all three required values, so \(I_1=1\). Record 2 is incomplete because \(X_2\) is missing, giving \(I_2=0\). Record 3 has a missing outcome, so \(I_3=0\). Record 4 is complete, giving \(I_4=1\). Record 5 is missing \(X_1\), record 6 is missing \(X_2\), and record 7 is missing \(X_2\); each has indicator zero. Record 8 is complete, so \(I_8=1\).
Therefore the indicator vector is \((1,0,0,1,0,0,0,1)\), and
The complete-case regression uses records 1, 4, and 8: 3 of the original 8 records. In particular, record 2 contributes zero to the count because its \(X_2\) value is missing, even though its outcome and \(X_1\) value are present.
What the Retained Sample Represents
Complete-case analysis changes which observed records are available to the regression. The resulting sample describes records that have all of the model’s required values—not automatically every record originally collected, and not automatically every member of a broader population of interest. Which kinds of cases remain depends on which records are complete.
This distinction matters for predictor coverage. The complete-case sample can have a narrower range of predictor values than the original data. For example, the most extreme observed age might belong to a record with a missing laboratory measurement. That age is present in the collected data, but the record cannot contribute to a regression that requires both age and that measurement. The fitted regression then has no complete cases at that observed age.
The same issue can arise for groups or settings. If many records from a particular clinic, age band, or treatment group lack a required variable, fewer such records may remain in the analysis. The complete-case data will then contain a different mix of observed cases. This describes the retained data; by itself, it does not establish why values are missing or whether the regression results are valid for a wider population. Those are separate questions.
Worked Example: Predictor Ranges After Exclusion
Consider a hypothetical regression of an outcome \(Y\) on age and a biomarker measurement. The table records seven people. A dash again indicates a missing value. For this model, a record must have all three values.
| Record | Age (years) | Biomarker (units) | \(Y\) |
|---|---|---|---|
| A | 20 | 5 | 70 |
| B | 24 | 7 | 75 |
| C | 28 | 9 | — |
| D | 32 | — | 79 |
| E | 36 | 13 | 82 |
| F | 60 | 18 | — |
| G | 68 | 16 | 88 |
Records A, B, E, and G have observed outcomes, ages, and biomarker measurements, so each is complete. Records C and F have missing outcomes, while D has a missing biomarker measurement. Thus,
Among the records with an observed age, the range is 20 to 68 years. The complete cases have ages 20, 24, 36, and 68 years, so their age range is also 20 to 68 years in this example. For the biomarker, the observed values range from 5 to 18 units. The complete-case biomarker values are 5, 7, 13, and 16 units, giving a range from 5 to 16 units. The observed maximum of 18 units belongs to record F, which is excluded because its outcome is missing.
The regression therefore has no complete observation at the recorded biomarker value of 18 units. The original table shows that such a value occurred, but it cannot inform this complete-case fit. This is a description of the data available to the model; it does not justify extending a fitted relationship beyond the predictor values represented by its complete cases.
The Complete-Case Sample Depends on the Model
Because completeness is defined using the outcome and every included predictor, the retained sample can change when the model changes. Adding a predictor adds another value that must be observed for a record to be retained. Removing a predictor can allow records with that predictor missing to be used, provided their outcome and all remaining predictors are observed. Thus, two regressions fitted to the same original data need not use the same records.
Worked Example: Adding a Predictor Changes the Count
A hypothetical data set has six records. First, a regression uses \(Y\), age, and treatment group. A second model adds a laboratory measurement as another predictor. The entries below are shown as “observed” or “missing” to focus on the completeness count.
| Record | \(Y\), age, and treatment | Laboratory measurement |
|---|---|---|
| 1 | All observed | Observed |
| 2 | All observed | Missing |
| 3 | At least one missing | Observed |
| 4 | All observed | Observed |
| 5 | At least one missing | Observed |
| 6 | All observed | Missing |
For the first model, records 1, 2, 4, and 6 are complete. Its indicators are \((1,1,0,1,0,1)\), so
For the expanded model, the laboratory measurement must also be observed. Records 2 and 6 now fail the rule, while records 3 and 5 were already incomplete. Only records 1 and 4 remain complete, giving indicators \((1,0,0,1,0,0)\) and
The expanded model uses 2 of the 6 records, compared with 4 for the first model. This difference follows directly from the inclusion rule; it does not mean that the data set itself changed. It means that adding a predictor changed which values were required for a record to enter the regression.
A Careful Workflow
Before interpreting a regression fit based on complete cases, make the selection rule explicit. A compact workflow helps prevent accidental inclusion of records that have a missing value in a required variable.
Name the outcome and every predictor in the regression being fitted. Do not use missingness elsewhere in the data table as an automatic reason to exclude a record.
For each record, verify that the outcome and every listed predictor have usable observed values. A single missing required value makes that record incomplete for this model.
Assign one to each complete record and zero to each incomplete record, then add them to obtain \(n_{\text{CC}}\).
Report the number retained and, where relevant, note changes in the observed groups or predictor ranges. Keep that description separate from claims about why data are missing or whether the analysis is valid.
Why This Selection Rule Matters
A complete-case count is more than a bookkeeping detail. It tells readers how many records contributed to the fitted regression and makes the data restriction visible. If a stated sample size is the original number of records rather than \(n_{\text{CC}}\), a reader may mistakenly believe that every record contributed.
The retained predictor ranges also help show what data the model actually uses. If complete cases cover a narrower range than the observed records, conclusions from the fitted relationship should not be described as though the excluded range were represented in the analysis. Likewise, a complete-case sample containing fewer records from a setting or group should be described as such, rather than assumed to mirror the original collection.
These descriptions do not, on their own, diagnose the missingness mechanism or establish whether complete-case regression produces valid estimates. A count identifies who meets the rule; a range summary identifies observed coverage among those retained. Whether the retained cases support a particular inferential target requires additional reasoning.
Common Mistakes
- Counting a record as complete because most values are present. For a model using \(Y, X_1,\) and \(X_2\), a missing \(X_2\) makes the record incomplete even when \(Y\) and \(X_1\) are observed.
- Using the original sample size as the regression sample size. The original count is \(n\); the complete-case count is the sum of the record indicators, \(n_{\text{CC}}\).
- Excluding records for missing variables not in the model. Apply the rule to the outcome and predictors specified for that regression, not indiscriminately to every column.
- Treating a recorded zero as missing. A zero is an observed value when it is a valid measurement. Check the data’s coding rules rather than assuming its meaning.
- Assuming the retained cases represent every collected case equally well. Complete-case selection can change observed group composition and predictor ranges. The count alone does not show that the retained sample is representative.
Check Your Understanding
Use the complete-case rule for the model named in each question.
- A regression uses \(Y\), \(X_1\), and \(X_2\). A record has observed \(Y\) and \(X_1\), but missing \(X_2\). What is its complete-case indicator, and why?
- In a data set of 40 records, 29 have observed values for the outcome and all three predictors. What is \(n_{\text{CC}}\)?
- A record is missing a variable that is not included in the specified regression, but its outcome and every included predictor are observed. Does the complete-case rule for that regression exclude it?
- The maximum observed predictor value belongs to a record whose outcome is missing. Explain whether that record can contribute to a complete-case regression using that outcome.
- A regression with two predictors retains 18 records. A third predictor is added, and five of those 18 records have that predictor missing. If no other records become complete, how many complete cases remain in the expanded model?