cleverly.datasets.make_missing_outcome#
- cleverly.datasets.make_missing_outcome(n: int = 1000, *, seed: int | Generator | None = None, strength: float = 1.0, backend: Literal['pandas', 'polars'] | str | None = None) tuple[Any, dict[str, float]][source]#
Missing outcomes, with a missingness mechanism that depends on treatment.
P(Delta = 1 | A, W)depends on bothAandW, so the complete cases carry a different covariate distribution from the sample – which is what the1 / pifactor in the clever covariate corrects for. Note that this alone does not make a complete-case analysis biased: under missingness at random a correctly specified outcome regression identifies the estimand without any missingness model at all. The mechanism is what supplies the other half of double robustness, for when the outcome model is wrong. Raisestrengthabove 1 for a process where it is.- Parameters:
- n
int Number of observations.
- seed
int,Generator,orNone Seed or NumPy random generator.
- strength
float How hard the process is for a complete-case analysis. See the Notes.
- backend{“pandas”, “polars”, “pyarrow”}
orNone, default=None Dataframe backend.
Noneuses pandas when installed, then the first available backend.
- n
- Returns: