cleverly.datasets.make_multi_arm#

cleverly.datasets.make_multi_arm(n: int = 1000, *, seed: int | Generator | None = None, backend: Literal['pandas', 'polars'] | str | None = None, family: str = 'gaussian') → tuple[Any, dict[str, float]][source]#

A three-armed confounded process with known counterfactual means.

family="binomial" gives the binary-outcome version, which is what rr and or – and the E-value built on them – need on a multi-valued treatment.

Parameters:
nint

Number of observations.

seedint, Generator, or None

Seed or NumPy random generator.

backend{“pandas”, “polars”, “pyarrow”} or None, default=None

Dataframe backend. None uses pandas when installed, then the first available backend.

family{“gaussian”, “binomial”}

Outcome family of the generated outcome.

Returns:
dataframe

Simulated observations with a three-level treatment column.

truthdict of str to float

Exact causal parameters for the data-generating process.