Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • TEFFECTS2: Module to Estimate Average Treatment Effects with Observational Data

    I would like to announce that teffects2, a Stata module to estimate average treatment effects with observational data, is now available in SSC.

    teffects2 estimates average treatment effects (ATEs) and average treatment effects on the treated (ATTs) using observational data. As in Stata's official teffects command, inverse probability weighting (IPW), augmented inverse probability weighting (AIPW), and inverse probability weighted regression adjustment (IPWRA) estimators are supported. However, unlike teffects, teffects2 supports covariate balancing estimation (as well as maximum likelihood estimation) of the propensity score.

    The estimators implemented by teffects2 are described in a paper by Słoczyński, Uysal, and Wooldridge (2025), "Covariate Balancing and the Equivalence of Weighting and Doubly Robust Estimators of Average Treatment Effects," which is available here: https://arxiv.org/abs/2310.18563

  • #2
    Jeff, thank you very much for this valuable contribution. If possible, the community would benefit greatly from a paper describing the module and providing examples. (perhaps in the Stata Journal?)

    Comment


    • #3
      A Stata Journal article may be in our future -- but probably not near future. Here's an example using the same data set that Stata uses to illustrate teffects. It is not a coincidence that, when using IPT to estimate the propensity score, ipw, aipw, and ipwra are all the same, and the first two have weights that are automatically normalized. We show this for both ATE and ATT (ATET) in our paper.

      Code:
      . webuse cattaneo2, clear
      (Excerpt from Cattaneo (2010) Journal of Econometrics 155: 138–154)
      
      . 
      . teffects2 ipw (bweight) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, logit), ate
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : IPW
      Outcome model  : weighted mean
      Treatment model: logit ML
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATE |  -236.0313   24.69296    -9.56   0.000    -284.4286   -187.6339
            POmean |   3403.276   9.506434   358.00   0.000     3384.644    3421.909
      ------------------------------------------------------------------------------
      
      . teffects2 ipw (bweight) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, ipt), ate
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : IPW
      Outcome model  : weighted mean
      Treatment model: logit IPT
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATE |  -238.3297   24.74015    -9.63   0.000    -286.8196   -189.8399
            POmean |   3403.442    9.50662   358.01   0.000     3384.809    3422.075
      ------------------------------------------------------------------------------
      
      . 
      . teffects2 ipwra (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, logit), ate
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : IPW regression adjustment
      Outcome model  : linear
      Treatment model: logit ML
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATE |  -238.4637    24.7411    -9.64   0.000    -286.9553    -189.972
            POmean |   3403.424    9.50767   357.97   0.000     3384.789    3422.059
      ------------------------------------------------------------------------------
      
      . teffects2 ipwra (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, ipt), ate
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : IPW regression adjustment
      Outcome model  : linear
      Treatment model: logit IPT
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATE |  -238.3297   24.74015    -9.63   0.000    -286.8196   -189.8399
            POmean |   3403.442    9.50662   358.01   0.000     3384.809    3422.075
      ------------------------------------------------------------------------------
      
      . 
      . teffects2 ipwra (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, logit), atet
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : IPW regression adjustment
      Outcome model  : linear
      Treatment model: logit ML
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATT |  -224.3819   22.87888    -9.81   0.000    -269.2237   -179.5401
            POmean |   3362.042   12.96242   259.37   0.000     3336.636    3387.448
      ------------------------------------------------------------------------------
      
      . teffects2 ipwra (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, ipt), atet
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : IPW regression adjustment
      Outcome model  : linear
      Treatment model: logit IPT
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATT |  -224.3749   22.87893    -9.81   0.000    -269.2168    -179.533
            POmean |   3362.035   12.96276   259.36   0.000     3336.628    3387.441
      ------------------------------------------------------------------------------
      
      . 
      . teffects2 aipw (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, logit), ate
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : augmented IPW
      Outcome model  : linear
      Treatment model: logit ML
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATE |   -239.225   24.68952    -9.69   0.000    -287.6156   -190.8344
            POmean |    3403.42   9.507863   357.96   0.000     3384.785    3422.055
      ------------------------------------------------------------------------------
      
      . teffects2 aipw (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, ipt), ate
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : augmented IPW
      Outcome model  : linear
      Treatment model: logit IPT
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATE |  -238.3297   24.74015    -9.63   0.000    -286.8196   -189.8399
            POmean |   3403.442    9.50662   358.01   0.000     3384.809    3422.075
      ------------------------------------------------------------------------------
      
      . 
      . teffects2 aipw (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, logit), atet
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : augmented IPW
      Outcome model  : linear
      Treatment model: logit ML
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATT |  -224.2581   22.88021    -9.80   0.000    -269.1025   -179.4137
            POmean |   3361.918   12.96506   259.31   0.000     3336.507    3387.329
      ------------------------------------------------------------------------------
      
      . teffects2 aipw (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby, ipt), atet
      
      Treatment effect estimation                     Number of obs     =      4,642
      Estimator      : augmented IPW
      Outcome model  : linear
      Treatment model: logit IPT
      ------------------------------------------------------------------------------
                   |               Robust
           bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -------------+----------------------------------------------------------------
               ATT |  -224.3749   22.87893    -9.81   0.000    -269.2168    -179.533
            POmean |   3362.035   12.96276   259.36   0.000     3336.628    3387.441
      ------------------------------------------------------------------------------
      
      . 
      . * teffects uses MLE for the propensity score. To reproduce the ipwra estimates using the "logit" (mle) option:
      . 
      . teffects ipwra (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby), ate
      
      Iteration 0:  EE criterion = 1.543e-20  
      Iteration 1:  EE criterion = 7.133e-26  
      
      Treatment-effects estimation                    Number of obs     =      4,642
      Estimator      : IPW regression adjustment
      Outcome model  : linear
      Treatment model: logit
      ----------------------------------------------------------------------------------------
                             |               Robust
                     bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -----------------------+----------------------------------------------------------------
      ATE                    |
                     mbsmoke |
      (Smoker vs Nonsmoker)  |  -238.4637    24.7411    -9.64   0.000    -286.9553    -189.972
      -----------------------+----------------------------------------------------------------
      POmean                 |
                     mbsmoke |
                  Nonsmoker  |   3403.424    9.50767   357.97   0.000     3384.789    3422.059
      ----------------------------------------------------------------------------------------
      
      . teffects ipwra (bweight prenatal1 mmarried mage c.mage#c.mage fbaby) (mbsmoke prenatal1 mmarried mage c.mage#c.mage fbaby), atet
      
      Iteration 0:  EE criterion = 7.214e-22  
      Iteration 1:  EE criterion = 1.345e-26  
      
      Treatment-effects estimation                    Number of obs     =      4,642
      Estimator      : IPW regression adjustment
      Outcome model  : linear
      Treatment model: logit
      ----------------------------------------------------------------------------------------
                             |               Robust
                     bweight | Coefficient  std. err.      z    P>|z|     [95% conf. interval]
      -----------------------+----------------------------------------------------------------
      ATET                   |
                     mbsmoke |
      (Smoker vs Nonsmoker)  |  -224.3819   22.87888    -9.81   0.000    -269.2237   -179.5401
      -----------------------+----------------------------------------------------------------
      POmean                 |
                     mbsmoke |
                  Nonsmoker  |   3362.042   12.96242   259.37   0.000     3336.636    3387.448
      ----------------------------------------------------------------------------------------

      Comment


      • #4
        Dear Prof. Wooldridge, many thanks for providing these interesting new commands! I am currently preparing a simulation to compare various Stata commands for estimating treatment effects and I will make sure to include teffects2. As far as I understand, the three different subcommands give identical results in the default option. So, is there any reason to prefer one subcommand over the other? As far as I have tested (quickly), teffects2 ipw is considerably faster than the other two, so I would potentially include only this.
        Best wishes

        Stata 18.0 MP | ORCID | Google Scholar

        Comment


        • #5
          Thank you, Jeff. That’s an excellent example. A brief, detailed paper in the Stata Journal, for instance, would be extremely helpful as a reference. Some grant agencies, and journals encourage citing the software package used.

          Comment


          • #6
            Originally posted by Felix Bittmann View Post
            Dear Prof. Wooldridge, many thanks for providing these interesting new commands! I am currently preparing a simulation to compare various Stata commands for estimating treatment effects and I will make sure to include teffects2. As far as I understand, the three different subcommands give identical results in the default option. So, is there any reason to prefer one subcommand over the other? As far as I have tested (quickly), teffects2 ipw is considerably faster than the other two, so I would potentially include only this.
            Yes, you are correct. The defaults for aipw and ipwra are linear mean (the only choice, in fact) and logit propensity score estimated by IPT. In this case, ipw, aipw, and ipwra are all equivalent.

            Comment

            Working...
            X