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
- Choose how many rows and where to stop observing. Mean lifetime is fixed at 50.
- Generate, and compare the naive mean of completed rows with the true mean of 50.
- Shorten the horizon and watch both the censored share and the bias grow.
- 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.
Related generators
- Regression Dataset GeneratorData built from a slope and intercept you choose, with the line fitted back out of it so you can see how close estimation gets.
- Changepoint Dataset GeneratorSeries containing a level shift at a known point, with the split independently recovered by minimising within-segment error.
- Outlier Dataset GeneratorContaminated samples where the planted outliers are labelled, so a detection rule can be scored on both kinds of error.
- Clustered Dataset GeneratorPoints grouped around known centres with the true group recorded, so you can check what a clustering algorithm actually recovered.