treatment effect IPW, RA, AIPW, ...

16 views
Skip to first unread message

josef...@gmail.com

unread,
Feb 8, 2022, 12:39:28 PM2/8/22
to pystatsmodels
I picked up another one of my 2015 PRs

Treatment effects under conditional independence, selection based on observables
uses GMM under the hood to compute inference (following Stata's approach)

should be ready to merge in a few days.

for docs, see stata manual for `teffects`

Josef

example based on unit test case

https://gist.github.com/josef-pkt/8a8755d2930cb23f7282cf683232bf17

teff = TreatmentEffect(mod, tind, results_select=res_probit)

for m, _ in methods:
    res = getattr(teff, m)()
    print("\n", m)
    print(res.summary_frame())

 ra
             coef    std err           z         P>|z|  Conf. Int. Low  Conf. Int. Upp.
ATE   -239.639211  23.824021  -10.058722  8.408247e-24     -286.333435      -192.944988
POM0  3403.242272   9.525207  357.288006  0.000000e+00     3384.573209      3421.911335
POM1  3163.603060  21.863509  144.697867  0.000000e+00     3120.751371      3206.454750

 ipw
             coef    std err           z         P>|z|  Conf. Int. Low  Conf. Int. Upp.
ATE   -230.688638  25.816745   -8.935621  4.048989e-19     -281.288528      -180.088748
POM0  3403.462709   9.571412  355.586256  0.000000e+00     3384.703085      3422.222332
POM1  3172.774071  24.001048  132.193145  0.000000e+00     3125.732880      3219.815261

 aipw
             coef    std err           z         P>|z|  Conf. Int. Low  Conf. Int. Upp.
ATE   -230.989648  26.214445   -8.811541  1.234375e-18     -282.369017      -179.610280
POM0  3403.355674   9.568514  355.682783  0.000000e+00     3384.601731      3422.109616
POM1  3172.366025  24.427402  129.869153  0.000000e+00     3124.489197      3220.242854

 aipw_wls
             coef    std err           z         P>|z|  Conf. Int. Low  Conf. Int. Upp.
ATE   -227.195618  27.372036   -8.300282  1.038645e-16     -280.843822      -173.547414
POM0  3403.250651   9.596571  354.631943  0.000000e+00     3384.441717      3422.059585
POM1  3176.055033  25.654642  123.800406  0.000000e+00     3125.772859      3226.337206

 ipw_ra
             coef    std err           z         P>|z|  Conf. Int. Low  Conf. Int. Upp.
ATE   -229.967078  26.629411   -8.635830  5.830196e-18     -282.159765      -177.774391
POM0  3403.335639   9.571288  355.577620  0.000000e+00     3384.576260      3422.095018
POM1  3173.368561  24.871955  127.588224  0.000000e+00     3124.620425      3222.116697


Reply all
Reply to author
Forward
0 new messages