API ReferenceEntry

classic_rct_gamma

classic_rct_gamma

Reference details for classic_rct_gamma in causalis.data_contracts.

classic_rct_gamma

Generate a classic RCT dataset with three binary confounders and a gamma outcome.

The gamma outcome uses a log-mean link, so treatment effects are multiplicative on the mean scale. The default parameters are chosen to resemble a skewed real-world metric (e.g., spend or revenue).

Parameters
  • n (int) – Number of samples to generate.
  • split (float) – Proportion of samples assigned to the treatment group.
  • random_state (int) – Random seed for reproducibility.
  • outcome_params (dict) – Gamma parameters, e.g. {"shape": 2.0, "scale": {"A": 15.0, "B": 16.5}}. Mean = shape * scale.
  • add_pre (bool) – Whether to generate a pre-period covariate (y_pre).
  • beta_y (array - like) – Linear coefficients for confounders in the log-mean outcome model.
  • outcome_depends_on_x (bool) – Whether to add default effects for confounders if beta_y is None.
  • prognostic_scale (float) – Scale of nonlinear prognostic signal.
  • pre_corr (float) – Target correlation for y_pre with post-outcome in control group.
  • add_ancillary (bool) – Whether to add standard ancillary columns (age, platform, etc.).
  • deterministic_ids (bool) – Whether to generate deterministic user IDs.
  • include_oracle (bool) – Whether to include oracle ground-truth columns like 'cate', 'propensity', etc.
  • return_causal_data (bool) – Whether to return a CausalData object instead of a pandas.DataFrame.
  • **kwargs – Additional arguments passed to generate_rct (e.g., pre_name, g_y, use_prognostic).
Returns