Skip to content

DOC/REF/ENH: follow-up to merging treatment effect #8327

Open

Description

@josef-pkt

I merged treatment effect #8034 essentially in the version where I stopped 4 months ago

Docs still need a lot of work, and we need a notebook (unit test has full example).
Simple example in class docstring would also be helpful.
The current docs are not very informative, no explanations and details (users would have to read the Stata docs)
TreatmentEffectResults class has no docstring.

The docs don't indicate that only OLS is supported as outcome model.
Need to warn or raise for current limitations.
current unit tests are OLS + Probit
I guess GLM-Binomial is not supported for treatment model, only Logit and Probit. ???

from_data method is not implemented

update

signature of treatment class might not be good
__init__(self, model, treatment, results_select=None, _cov_type="HC0", **kwds):

why is results select_optional?
why is results_select after treatment?
design/signature if only one model is used, ipw and ra?

we always need the outcome and the treatment variable,
outcome variable is only in outcome model,
treatment indicator is treatment argument but also in results_select if that is provided

signature might be a left over of the original implementation for ra

Activity

  1. added this to the 0.14 milestone on Jun 22, 2022
  2. josef-pkt commented on Jun 22, 2022

    @josef-pkt
    MemberAuthor

    my notebook ex_treatment_effect.ipynb looks pretty clean
    seems to be the version I wrote for the docs, same case as in unit test

    (my other notebooks are dev notebooks that also include earlier versions of the classes)

    update

    An earlier version of the notebook is in a gist announced in the mailing list
    https://groups.google.com/g/pystatsmodels/c/KHhtyZgv74k
    https://gist.github.com/josef-pkt/8a8755d2930cb23f7282cf683232bf17

  3. josef-pkt commented on Jun 22, 2022

    @josef-pkt
    MemberAuthor

    need to collect possible (smaller) improvements, e.g.

    • GMM uses generic param names, e.g. print(res.results_gmm.summary()) is not informative about what the params are.
      this will need some multi-model naming convention
    • ...
  4. josef-pkt commented on Jun 22, 2022

    @josef-pkt
    MemberAuthor

    check and unit test other options, or maybe warn
    For example:
    Logit and Probit now have offset. I have not looked at the offset case in treatment effect given that it was added after my main treatment effect work.
    When we support GLM, then we also need to check or disallow other options like freq_ or var_weights

  5. josef-pkt commented on Sep 6, 2023

    @josef-pkt
    MemberAuthor

    a tutorial with several treatment effects methods
    also with G-formula (which I was/am not clear about based on skimming part of the literature a while ago)

    Smith, Matthew J., Camille Maringe, Bernard Rachet, Mohammad A. Mansournia, Paul N. Zivich, Stephen R. Cole, and Miguel Angel Luque-Fernandez. “Tutorial: Introduction to Computational Causal Inference Using Reproducible Stata, R and Python Code.” arXiv, December 21, 2020. https://doi.org/10.48550/arXiv.2012.09920.

    https://github.com/migariane/TutorialCausalInferenceEstimators/tree/master

    There is already the published version (that I downloaded half a year ago)

    Smith, Matthew J., Mohammad A. Mansournia, Camille Maringe, Paul N. Zivich, Stephen R. Cole, Clémence Leyrat, Aurélien Belot, Bernard Rachet, and Miguel A. Luque-Fernandez. “Introduction to Computational Causal Inference Using Reproducible Stata, R, and Python Code: A Tutorial.” Statistics in Medicine 41, no. 2 (2022): 407–32. https://doi.org/10.1002/sim.9234.

    related
    G-formula for "panel" data, i.e. repeated observations with different treatment histories

    Zivich, Paul N., Rachael K. Ross, Bonnie E. Shook-Sa, Stephen R. Cole, and Jessie K. Edwards. “Empirical Sandwich Variance Estimator for Iterated Conditional Expectation G-Computation.” arXiv, June 19, 2023. https://doi.org/10.48550/arXiv.2306.10976.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions