Data Matrix View Student Econometrics
Click any cell to toggle NA
Inject Mechanism:
Audit Diagnostics & Drift na.omit() active
Attrition Detected
Original N
24
Total rows captured
Cleaned N
16
complete observations
Sample Attrition
33.3%
8 rows omitted
Total NAs
8
sum(is.na(data))
Selection Bias & Moment Drift (`mean()` and `sd()`)
Δ = Cleaned - Raw
| Variable | Raw Mean | Clean Mean | Δ Mean Shift | Raw SD | Clean SD |
|---|
RStudio Replication Script (Console)
Econometric Caution: Why na.omit() Can Induce Bias
In real-world data collection, values are rarely missing completely at random (MCAR). When high-income survey respondents or struggling students omit responses (MNAR), running na.omit(data) disproportionately deletes a non-random subpopulation.
Notice above how omitting missing rows can artificially elevate sample means or restrict standard deviations. Consider using targeted complete.cases() on actual regressors or modern multiple imputation rather than naive dataset-wide deletion.