Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RD

From   "Patrick Button" <>
Subject   Re: st: RD
Date   Thu, 26 Apr 2012 11:48:42 -0700

Hi Ana,

Are you referring to the RD program that was created by Austin Nichols?

If so, the coefficient estimates are easy to get. Here is an example using
some code that I have from Lee, Moretti, and Bulter (2004) (data is here:


set memory 500m

use c:\~\enricoall2.dta, clear

*The running/assignment variable is the Democratic Share of the two party
*which is called demvoteshare. I am centering the variable so that the
*occurs at zero. This just makes the interpretation of results easier
gen z = demvoteshare - 0.5

*My outcome variable is ADA score

*Running the RD program to get local linear estimates (using a triangular
rd ada_vs z, kernel(tri)

Two variables specified; treatment is
assumed to jump from zero to one at Z=0.

 Assignment variable Z is z
 Treatment variable X_T unspecified
 Outcome variable y is ada_vs

(11606 missing values generated)
(11606 missing values generated)
(11606 missing values generated)
Estimating for bandwidth .1905888865693358
Estimating for bandwidth .0952944432846679
Estimating for bandwidth .3811777731386716
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf.
       lwald |   52.10493   1.332489    39.10   0.000      49.4933   
     lwald50 |   51.75824   1.888753    27.40   0.000     48.05635   
    lwald200 |   51.77842    1.05434    49.11   0.000     49.71195   


The coefficient of interest is in the row with lwald (so 52.10). This is
the estimate under the bandwidth that's selected using the Imbens and
Kalyanaraman (2009) procedure. The other coefficients are estimates with
different bandwidths. lwald50 is half this optimal bandwidth. lwald200 is
twice. You'll see above that the optimal bandwidth was calculated as

If you want to retrieve this coefficient estimate, it should be available
from e(b). The program saves coefficient results in this vector.

Try this:

matrix coeffs = e(b)
gen maincoeff = coeffs[1,1]

That will store the coefficient of interest in a variable for you, or you
could modify that code to save it into a particular cell of a matrix.

Hope that helps

Patrick Button

PhD Candidate
Department of Economics
University of California, Irvine

> Dear all,
> How can I retrieve the estimated coefficient for the covariates when using
> rd command in stata?
> Thanks in advance for help.
> Ana.
> *
> *   For searches and help try:
> *
> *
> *

*   For searches and help try:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index