GenerateRandomSearch

Time-to-Event Dataset Generator

When observation stops before everything has finished, the rows still running are censored — you know they lasted at least that long and no more. The tempting move is to drop them and average what completed, and that is systematically wrong, because the rows you discard are precisely the long-lived ones. This generates lifetimes with a censoring horizon you control and puts the naive average next to the true mean so the size of the bias is visible.

What this generator does

Draws true lifetimes from an exponential distribution with a mean of 50, then applies a horizon: any row still running at that time is recorded at the horizon and marked censored rather than as an event. It reports the censored share and the mean of the completed rows alone, so the gap against the true mean of 50 can be read directly.

How to use this tool

  1. Choose how many rows and where to stop observing. Mean lifetime is fixed at 50.
  2. Generate, and compare the naive mean of completed rows with the true mean of 50.
  3. Shorten the horizon and watch both the censored share and the bias grow.
  4. Copy as CSV — the event column marks which rows finished.

Understanding the controls

How many rows
Between 20 and 400 units observed. More rows make the censored share settle closer to the proportion the horizon implies.
Observation horizon
Between 5 and 200. Anything still running at this time is censored. A short horizon censors most of the data and biases the naive average badly.
Seed
Any word reproduces the same lifetimes and the same censoring pattern.

Common use cases

  • Teaching why censored observations cannot simply be dropped
  • Test data for a Kaplan–Meier or survival-model implementation
  • Equipment reliability and time-to-failure exercises
  • Showing how a study horizon biases an apparent average
  • Setting the same dataset twice from a seed

How this generator works

Exponential lifetimes are produced by inverse transform sampling. A row whose true lifetime exceeds the horizon is recorded at the horizon with its event flag cleared — which is exactly what right-censoring means. The checks confirm no censored row is recorded anywhere but at the horizon, no event is recorded after it, and no time is negative, because those three facts are what a survival method relies on.

Randomness and fairness

The lifetimes are random; the censoring is deterministic given the horizon, and every reported figure is recomputed from the finished rows. A seed reproduces the dataset exactly and is 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

  • Type I censoring only — every unit is observed to the same fixed horizon, rather than entering at different times.
  • Lifetimes are exponential, so the failure rate is constant and there is no wear-in or wear-out.
  • Mean lifetime is fixed at 50 so the bias in the naive average is easy to read.
  • No survival curve is fitted; this generates the data that a survival method would then be applied to.
  • This is a general reliability model and is not offered for any medical or clinical purpose.
  • Datasets are not stored between visits; seed one you want again.

Privacy and your data

The lifetimes and every summary are computed entirely in your browser. Nothing about the data or your seed is transmitted or kept.