causalkit.inference.gate_esimand#

causalkit.inference.gate_esimand(data, groups=None, n_groups=5, ml_g=None, ml_m=None, n_folds=5, n_rep=1, confidence_level=0.95)[source]#

Estimate Group Average Treatment Effects (GATEs) by grouping observations using CATE-based quantiles unless custom groups are provided.

Parameters:
  • data (CausalData) – The (possibly filtered) CausalData object. Filtering should be done by subsetting data.df before constructing CausalData, or by preparing a filtered CausalData instance.

  • groups (pd.Series or pd.DataFrame, optional) – Group assignments per observation. If a Series is passed, it will be used as a single column named ‘q’. If a DataFrame, it should contain a single column specifying groups. If None, groups are formed by pd.qcut over the in-sample CATEs into n_groups quantiles labeled 0..n_groups-1.

  • n_groups (int, default 5) – Number of quantile groups if groups is None.

  • ml_g (Optional[Any]) – Learners and DoubleML cross-fitting controls (as in ATE/ATT).

  • ml_m (Optional[Any]) – Learners and DoubleML cross-fitting controls (as in ATE/ATT).

  • n_folds (int) – Learners and DoubleML cross-fitting controls (as in ATE/ATT).

  • n_rep (int) – Learners and DoubleML cross-fitting controls (as in ATE/ATT).

  • confidence_level (float, default 0.95) – Confidence level for two-sided normal-approximation intervals.

Returns:

A DataFrame with columns:
  • group: group label

  • n: group size

  • theta: estimated group average treatment effect

  • std_error: standard error (normal approx if fallback path)

  • p_value: two-sided p-value for H0: theta=0

  • ci_lower, ci_upper: confidence interval bounds

Return type:

pd.DataFrame