Saturday, March 14, 2026

Introduction to remedy results in Stata: Half 2


This put up was written collectively with David Drukker, Director of Econometrics, StataCorp.

In our final put up, we launched the idea of remedy results and demonstrated 4 of the treatment-effects estimators that have been launched in Stata 13.  Immediately, we are going to discuss two extra treatment-effects estimators that use matching.

Introduction

Final time, we launched 4 estimators for estimating the common remedy impact (ATE) from observational information.  Every of those estimators has a distinct approach of fixing the missing-data downside that arises as a result of we observe solely the potential end result for the remedy stage acquired.  Immediately, we introduce estimators for the ATE that resolve the missing-data downside by matching.

Matching pairs the noticed end result of an individual in a single remedy group with the result of the “closest” particular person within the different remedy group. The end result of the closest particular person is used as a prediction for the lacking potential end result. The common distinction between the noticed end result and the anticipated end result estimates the ATE.

What we imply by “closest” is determined by our information. Matching topics based mostly on a single binary variable, corresponding to intercourse, is easy: males are paired with men and women are paired with females. Matching on two categorical variables, corresponding to intercourse and race, isn’t rather more tough. Matching on steady variables, corresponding to age or weight, might be trickier due to the sparsity of the info. It’s unlikely that there are two 45-year-old white males who weigh 193 kilos in a pattern. It’s even much less seemingly that a kind of males self-selected into the handled group and the opposite self-selected into the untreated group. So, in such circumstances, we match topics who’ve roughly the identical weight and roughly the identical age.

This instance illustrates two factors. First, there’s a price to matching on steady covariates; the shortcoming to seek out good matches with multiple steady covariate causes large-sample bias in our estimator as a result of our matches turn into more and more poor.

Second, we should specify a measure of similarity. When matching immediately on the covariates, distance measures are used and the closest neighbor chosen. An alternate is to match on an estimated chance of remedy, often called the propensity rating.

Earlier than we focus on estimators for observational information, we observe that matching is typically utilized in experimental information to outline pairs, with the remedy subsequently randomly assigned inside every pair. This use of matching is said however distinct.

Nearest-neighbor matching

Nearest-neighbor matching (NNM) makes use of distance between covariate patterns to outline “closest”. There are numerous methods to outline the gap between two covariate patterns. We might use squared variations as a distance measure, however this measure ignores issues with scale and covariance. Weighting the variations by the inverse of the pattern covariance matrix handles these points. Different measures are additionally used, however these particulars are much less necessary than the prices and advantages of NNM dropping the functional-form assumptions (linear, logit, probit, and many others.) used within the estimators mentioned final time.

Dropping the functional-form assumptions makes the NNM estimator rather more versatile; it estimates the ATE for a a lot wider class of fashions. The price of this flexibility is that the NNM estimator requires rather more information and the quantity of knowledge it wants grows with every extra steady covariate.

Within the earlier weblog entry, we used an instance of mom’s smoking standing on birthweight. Let’s rethink that instance.


. webuse cattaneo2.dta, clear

Now, we use teffects nnmatch to estimate the ATE by NNM.


. teffects nnmatch (bweight mmarried mage fage medu prenatal1) (mbsmoke)

Therapy-effects estimation                    Variety of obs      =      4642
Estimator      : nearest-neighbor matching      Matches: requested =         1
Final result mannequin  : matching                                      min =         1
Distance metric: Mahalanobis                                   max =        16
------------------------------------------------------------------------------
             |              AI Strong
     bweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
ATE          |
     mbsmoke |
    (smoker  |
         vs  |
 nonsmoker)  |  -210.5435   29.32969    -7.18   0.000    -268.0286   -153.0584
------------------------------------------------------------------------------

The estimated ATE is -211, which means that infants would weigh 211 grams much less when all moms smoked than when no moms smoked.

The output additionally signifies that ties in distance induced at the very least one statement to be matched with 16 different observations, despite the fact that we requested solely matching. NNM averages the outcomes of all of the tied-in-distance observations, because it ought to. (They’re all equally good and utilizing all of them will scale back bias.)

NNM on discrete covariates doesn’t assure actual matching. For instance, some married ladies may very well be matched with single ladies. We most likely want actual matching on discrete covariates, which we do now.


. teffects nnmatch (bweight mmarried mage fage medu prenatal1) (mbsmoke), ///
         ematch(mmarried prenatal1) 

Therapy-effects estimation                    Variety of obs      =      4642
Estimator      : nearest-neighbor matching      Matches: requested =         1
Final result mannequin  : matching                                      min =         1
Distance metric: Mahalanobis                                   max =        16
------------------------------------------------------------------------------
             |              AI Strong
     bweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
ATE          |
     mbsmoke |
    (smoker  |
         vs  |
 nonsmoker)  |  -209.5726   29.32603    -7.15   0.000    -267.0506   -152.0946
------------------------------------------------------------------------------

Precise matching on mmarried and prenatal1 modified the outcomes a bit of bit.

Utilizing multiple steady covariate introduces large-sample bias, and we’ve got three. The choice biasadj() makes use of a linear mannequin to take away the large-sample bias, as urged by Abadie and Imbens (2006, 2011).


. teffects nnmatch (bweight mmarried mage fage medu prenatal1) (mbsmoke), ///
         ematch(mmarried prenatal1)  biasadj(mage fage medu)

Therapy-effects estimation                    Variety of obs      =      4642
Estimator      : nearest-neighbor matching      Matches: requested =         1
Final result mannequin  : matching                                      min =         1
Distance metric: Mahalanobis                                   max =        16
------------------------------------------------------------------------------
             |              AI Strong
     bweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
ATE          |
     mbsmoke |
    (smoker  |
         vs  |
 nonsmoker)  |  -210.0558   29.32803    -7.16   0.000    -267.5377   -152.5739
------------------------------------------------------------------------------

On this case, the outcomes modified by a small quantity. Typically, they’ll change so much, and the quantity will increase with the variety of steady
covariates.

Propensity-score matching

NNM makes use of bias adjustment to take away the bias attributable to matching on multiple steady covariate. The generality of this method makes it very interesting, however it may be tough to consider problems with match and mannequin specification. Propensity-score matching (PSM) matches on an estimated chance of remedy often called the propensity rating. There isn’t any want for bias adjustment as a result of we match on just one steady covariate. PSM has the additional benefit that we will use all the usual strategies for checking the match of binary regression fashions previous to matching.

We estimate the ATE by PSM utilizing teffects psmatch.


. teffects psmatch (bweight) (mbsmoke mmarried mage fage medu prenatal1 ) 

Therapy-effects estimation                    Variety of obs      =      4642
Estimator      : propensity-score matching      Matches: requested =         1
Final result mannequin  : matching                                      min =         1
Therapy mannequin: logit                                         max =        16
------------------------------------------------------------------------------
             |              AI Strong
     bweight |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
ATE          |
     mbsmoke |
    (smoker  |
         vs  |
 nonsmoker)  |  -229.4492   25.88746    -8.86   0.000    -280.1877   -178.7107
------------------------------------------------------------------------------

The estimated ATE is now -229, bigger in magnitude than the NNM estimates however not considerably so.

How to decide on among the many six estimators

We now have six estimators:

  1. RA: Regression adjustment
  2. IPW: Inverse chance weighting
  3. IPWRA: Inverse chance weighting with regression adjustment
  4. AIPW: Augmented inverse chance weighting
  5. NNM: Nearest-neighbor matching
  6. PSM: Propensity-score matching

The ATEs we estimated are

  1. RA: -277.06
  2. IPW: -275.56
  3. IPWRA: -229.97
  4. AIPW: -230.99
  5. NNM: -210.06
  6. PSM: -229.45

Which estimator ought to we use?

We might by no means recommend looking out the above desk for the end result that most nearly fits your needs and biases. The selection of estimator must be made beforehand.

So, how can we select?

Listed below are some guidelines of thumb:

  1. Underneath appropriate specification, all of the estimators ought to produce related outcomes. (Related estimates don’t assure appropriate specification as a result of all of the specs may very well be improper.)
  2. When you already know the determinants of remedy standing, IPW is a pure base-case estimator.
  3. If you as a substitute know the determinants of the result, RA is a pure base-case estimator.
  4. The doubly strong estimators, AIPW and IPWRA, give us an additional shot at appropriate specification.
  5. When you will have a number of steady covariates, NNM will crucially hinge on the bias adjustment, and the computation will get to be extraordinarily tough.
  6. When you already know the determinants of remedy standing, PSM is one other base-case estimator.
  7. The IPW estimators will not be dependable when the estimated remedy possibilities get too near 0 or 1.

Ultimate ideas

Earlier than we go, we reiterate the cautionary observe from our final entry. Nothing concerning the arithmetic of treatment-effects estimators magically extracts causal relationships from observational information. We can not thoughtlessly analyze our information utilizing Stata’s teffects instructions and infer a causal relationship. The fashions should be supported by scientific idea.

If you want to study extra about remedy results in Stata, there’s a complete guide dedicated to the treatment-effects options in Stata 14; it features a primary introduction, a sophisticated introduction, and plenty of labored examples. In Stata, sort assist teffects:


.  assist teffects 

Title

     [TE] teffects—Therapy-effects estimation for observational information

Syntax

The title [TE] teffects shall be in blue, which suggests it’s clickable. Click on on it to go to the Therapy-Results Reference Guide.

Or obtain the guide from our web site; go to

http://www.stata.com/manuals14/te/

References

Abadie, A., and Imbens, G. W. 2006. Giant pattern properties of matching estimators for common remedy results. Econometrica 74: 235–267.

Abadie, A., and Imbens, G. W. 2011. Bias-corrected matching estimators for common remedy results. Journal of Enterprise and Financial Statistics 29: 1–11.

Cattaneo, M. D. 2010. Environment friendly semiparametric estimation of multi-valued remedy results below ignorability. Journal of Econometrics 155: 138–154.

 



Related Articles

Latest Articles