gphk-metrics / stata-multe

Multiple Treatment Effects
17 stars 4 forks source link

Adapt MulTE from R #14

Closed mcaceresb closed 6 months ago

mcaceresb commented 6 months ago
mcaceresb commented 6 months ago

EDIT: I mean this branch: https://github.com/gphk-metrics/stata-multe/tree/issue14_copyR

@peterdhull First pass in issue branch. Example:

. use test/example_fryer_levitt.dta, clear

. multe std_iq_24 i.age_24 female [w=W2C0], treat(race) strat(SES_quintile)
(analytic weights assumed)

             |      PL      OWN      ATE       EW       CW 
-------------+---------------------------------------------
       Black |  -.2574   -.2482   -.2655    -.255   -.2604 
          SE |  .02812   .02906   .02983   .02888   .02925 
    Hispanic |  -.2931   -.2829   -.2992   -.2862   -.2944 
          SE |  .02596   .02673   .02988    .0268   .02792 
       Asian |  -.2621   -.2609   -.2599   -.2611   -.2694 
          SE |  .03426   .03432   .04177   .03433   .04751 
       Other |  -.1563   -.1448   -.1503   -.1447   -.1522 
          SE |  .03691   .03696   .03594   .03684   .03698 

Some Qs for you and @kolesarm:

peterdhull commented 6 months ago

Thanks @mcaceresb! I don't see a reason why we shouldn't return the full vcov. I'll let @kolesarm weigh in on the other two questions.

kolesarm commented 6 months ago
mcaceresb commented 6 months ago

@kolesarm

kolesarm commented 6 months ago
mcaceresb commented 6 months ago

@peterdhull This should be ready to go functionality-wise. What's left is updating the docs and adding some (basic) tests. Current output:

. use test/example_fryer_levitt.dta, clear

. multe std_iq_24 i.age_24 female [w=W2C0], treat(race) strat(SES_quintile)
(analytic weights assumed)

PL Estimates (full sample)                      Number of obs     =      8,806

------------------------------------------------------------------------------
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        race |
      Black  |  -.2574154   .0281244    -9.15   0.000    -.3125383   -.2022925
   Hispanic  |  -.2931465    .025962   -11.29   0.000    -.3440311    -.242262
      Asian  |   -.262108    .034262    -7.65   0.000    -.3292603   -.1949557
      Other  |  -.1563373   .0369127    -4.24   0.000    -.2286848   -.0839898
------------------------------------------------------------------------------

Alternative Estimates on Full Sample:

             |      PL      OWN      ATE       EW       CW 
-------------+---------------------------------------------
       Black |  -.2574   -.2482   -.2655    -.255   -.2604 
          SE |  .02812   .02906   .02983   .00667   .02925 
    Hispanic |  -.2931   -.2829   -.2992   -.2862   -.2944 
          SE |  .02596   .02673   .02988   .00483   .02792 
       Asian |  -.2621   -.2609   -.2599   -.2611   -.2694 
          SE |  .03426   .03432   .04177   .00331   .04751 
       Other |  -.1563   -.1448   -.1503   -.1447   -.1522 
          SE |  .03691   .03696   .03594   .00494   .03698 

P-values for null hypothesis of no propensity score variation:
Wald test:  2.1e-188
  LM test:  8.8e-197

Note: You can post any combination of results from the table to Stata:

    multe, est(estimate) [{full|overlap} diff oracle]

Examples:

    multe, est(ATE) full oracle
    multe, est(CW)  overlap diff
mcaceresb commented 6 months ago

@kolesarm I copied the examples from the vignette into the README here, LMK if the plagiarism is fine (I do say I copy it from your vignette).

@peterdhull Sorry I actually still have a bit of work to do here; I just realized that Stata is dropping collinear covariate levels from the interacted specification, meaning it's the same in the full sample and overlap samples. I can just implement it myself to force it to fail in that case.

kolesarm commented 6 months ago

Plagiarism is fine, it's actually better to have the same examples (and say that).

Output looks good, but I agree, you need to force it to fail rather than silently drop collinear covariate levels for the ATE.

mcaceresb commented 6 months ago

Continued in #15