GenerateRandomSearch

Missing Data Generator

Dropping incomplete rows is safe when values are missing completely at random, and quietly biases everything when they are not. The usual diagnostic — compare the missingness rate between two halves of another column — separates the safe case from the rest and then stops. It cannot tell you whether the gaps depend on something you recorded or on the very value that is absent, and no test on the data can. This generates all three mechanisms, and because it keeps the values it removed, it can show you the bias itself rather than describing it.

What this generator does

Builds an age, income and hours table, removes income values under one of three mechanisms and hours values completely at random, so a row can be incomplete in more than one place. It reports the rate overall and for the younger and older halves, how many rows a complete-case analysis would drop, and the mean income before and after removal.

How to use this tool

  1. Choose the pattern and roughly what share of values should be missing.
  2. Compare the missingness rate between the younger and older halves — and notice that the last two patterns look alike on it.
  3. Note how different the two patterns look on that one measure.
  4. Copy the CSV to test an imputation method.

Understanding the controls

How many rows
Between 20 and 500 rows of age and income, split at the median age for the diagnostic.
Pattern
Completely at random removes values independently of everything. Missing at random removes far more from older rows — visible, and correctable, because age is recorded for everyone. Missing not at random removes far more of the high incomes, which is neither.
Missing rate (%)
Roughly what share of income values are absent overall.
Seed
Reproduces the same rows and the same gaps.

Common use cases

  • Test data for imputation and missing-value handling
  • Showing when complete-case analysis is safe and when it is not
  • Teaching the difference between missing at random and not
  • Checking that a pipeline handles empty cells at all
  • Reproducing the same pattern of gaps from a seed

How this generator works

The age-dependent pattern applies a much higher removal chance above the median age; the not-at-random pattern applies it above the median income instead. Both produce a large split by age, which is exactly the difficulty: the diagnostic reports “not completely at random” for both and cannot say which is at work. What separates them is measurable only here — under the not-at-random pattern the values that were removed are markedly larger than the ones that survived. Every claim is re-checked against the rows before display, and the split by age is judged as a two-proportion z rather than a fixed number of percentage points, because two halves that are genuinely alike differ by several points quite often.

Randomness and fairness

Ages, incomes and which values go missing are random; the pattern is enforced and verified. Seeded datasets reproduce exactly and are therefore explicitly not cryptographically secure. Without a seed the browser's cryptographically secure generator is used.

For how randomness is produced across the whole site, see how Generate Random works.

Limitations and good to know

  • The not-at-random pattern cannot be identified from the data. This page can show its bias only because it kept the values it removed, which is exactly what a real dataset cannot do.
  • Three columns only — age, income and hours — chosen because the dependency between them is intuitive. Age is never missing, since the diagnostic needs a complete column to split on.
  • No imputation is performed; this generates the problem rather than solving it.
  • Rates are approximate, since each row is decided independently.
  • Rows are discarded when you leave; seed them to test two imputation methods on identical gaps.

Privacy and your data

Rows and gaps are generated in your browser. Nothing about the data or your seed leaves the page.