cleverly.datasets.make_longitudinal_competing#
- cleverly.datasets.make_longitudinal_competing(n: int = 2000, *, seed: int | Generator | None = None, censoring: bool = True, backend: Literal['pandas', 'polars'] | str | None = None) tuple[Any, dict[str, float]][source]#
Two time points, two competing absorbing causes at each, monotone censoring.
The competing-risks counterpart of
make_longitudinal_survival(), sharing its hazards and its time-varying confounding: an event happens with the same all-cause probability, and a second draw decides which cause it was. Returns(frame, truth).The frame is wide, with columns
W1,W2,A1,C1,R1,D1,L2,A2,C2,R2,D2in time order – one indicator per cause per node, which is the declarationLongitudinalDatatakes. A unit that is censored or that has either event hasnanat every node after.truthholdscif_regimen[..., cause @ t=k]for the four static regimens at both causes and both horizons, and the contrast ofalwaysagainstneverat each, under the names a fit reports them by – so a coverage study looks each up by the name it read off the result.- Parameters:
- n
int Number of units.
- seed
int,Generator,orNone Seed or NumPy random generator.
- censoringbool
Whether to generate monotone censoring. False leaves every unit observed.
- backend{“pandas”, “polars”, “pyarrow”}
orNone, default=None Dataframe backend.
Noneuses pandas when installed, then the first available backend.
- n
- Returns: