py-why / py-why/EconML

Testing for heterogeneity

Open
#963 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.8k
Forks
827
PR merge metrics
No merged PRs in 30d

Description

I read about the following "simple test" for heterogeneity in Athey & Wager 2019 (Estimating Treatment Effects with Causal Forests: An Application). : "A first, simple approach to testing for heterogeneity involves grouping observations according to whether their out-of-bag CATE estimates are above or below the median CATE estimate, and then estimating average treatment effects in these two subgroups separately using the doubly robust approach. This procedure is somewhat heuristic, as the "high" and "low" subgroups are not independent of the scores used to estimate the within-group effects; however, the subgroup definition does not directly depend on the outcomes or treatments (Yi;Wi) themselves, and it appears that this approach can provide at least qualitative insights about the strength of heterogeneity."

In econml, do you think this code snippet correctly implements this heuristic test?

ate_overall = econml_model.ate(X, T0=T0, T1=T)
ate_interval = econml_model.ate_interval(X, T0=T0, T1=T)
effects = econml_model.effect(X=X, T0=T0, T1=T)
median_effect = np.median(effects)
above_median = effect > median_effect
below_median = ~above_median
ate_above = econml_model.ate(
    X.loc[above_median, :],
    T0=T0.loc[above_median, :],
    T1=T.loc[above_median, :],
)
ate_below = econml_model.ate(
    X.loc[below_median, :],
    T0=T0.loc[below_median, :],
    T1=T.loc[below_median, :],
)

Thanks for your help!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the econml_model.effect and ate calls shown in the issue, then consult the cited Athey & Wager 2019 heuristic. Determine whether the subgrouping and treatment-effect estimates match that procedure; done means a documented yes/no answer with any needed clarification or correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.