Skip to contents

A reproducibly simulated randomised clinical trial, for time-to-event (survival) and imbalanced-classification examples. The two arms have a real survival difference: the treatment arm has a lower hazard, so the Kaplan-Meier curves separate clearly and the log-rank test is highly significant, and - because its event times are longer - the treatment arm is more often right-censored by the 36-month study end. age and biomarker also affect the hazard. The data feed survival_plot() (pass time, event and arm, or a survival::survfit object).

Usage

clinical_trial

Format

A data frame with 300 rows and 7 variables:

patient

Patient identifier.

arm

Treatment arm (factor): placebo or treatment.

age

Age in years at enrolment.

biomarker

Standardised baseline laboratory value.

time

Follow-up time, in months.

event

Event indicator: 1 event observed, 0 right-censored.

adverse_event

Rare adverse-event indicator: 1 yes, 0 no (about 10% positive).

Source

Simulated; see data-raw/generate_datasets.R.

Details

adverse_event is a deliberately rare binary safety outcome (about a 10% base rate) that is predictable from arm, age and biomarker. It gives the precision-recall (pr_curve_plot()), cumulative-gains (gain_plot()), lift (lift_plot()) and calibration (calibration_plot()) demos a genuinely imbalanced target, where those charts are most informative.

The data are synthetic, generated by data-raw/generate_datasets.R with a fixed seed; they do not describe any real individuals.