RDestimate
supports both sharp and fuzzy RDD
utilizing the AER package for 2SLS regression
under the fuzzy design. Local linear regressions are performed
to either side of the cutpoint using the Imbens-Kalyanaraman
optimal bandwidth calculation, IKbandwidth
.
RDestimate(formula, data, subset = NULL, cutpoint = NULL, bw = NULL, kernel = "triangular", se.type = "HC1", cluster = NULL, verbose = FALSE, model = FALSE, frame = FALSE)
y ~ x
for a simple sharp RDD, or y ~ x | c1 + c2
for a sharp RDD with two covariates. Fuzzy RDD may be specified as
y ~ x + z
where x
is the running variable, and
z
is the endogenous treatment variable. Covariates are then included in the
same manner as in a sharp RDD."triangular"
kernel is the default and is the "correct" theoretical kernel to be used for
edge estimation as in RDD (Lee and Lemieux 2010). Other options are "rectangular"
,
"epanechnikov"
, "quartic"
,
"triweight"
, "tricube"
, "gaussian"
and "cosine"
.vcovHC
, "HC3"
, "const"
, "HC"
, "HC0"
,
"HC1"
, "HC2"
, "HC4"
, "HC4m"
, "HC5"
. This option
is overriden by cluster
.se.type
. It is suggested that data with a discrete running
variable be clustered by each unique value of the running variable (Lee and Card 2008).TRUE
, the model object will be returned.TRUE
, the data frame used in model fitting will be returned.RDestimate
returns an object of class "RD
".
The functions summary
and plot
are used to obtain and print a summary and plot of
the estimated regression discontinuity. The object of class RD
is a list
containing the following components:
"sharp"
or "fuzzy"
RDD.lm
objects is returned.
For a fuzzy design, a list of lists is returned, each with two elements: firststage
, the first stage lm
object, and iv
, the ivreg
object. A model is returned for each corresponding bandwidth.Imbens, Guido and Thomas Lemieux. (2010) "Regression discontinuity designs: A guide to practice," Journal of Econometrics. 142(2): 615-635. http://dx.doi.org/10.1016/j.jeconom.2007.05.001
Lee, David and David Card. (2010) "Regression discontinuity inference with specification error," Journal of Econometrics. 142(2): 655-674. http://dx.doi.org/10.1016/j.jeconom.2007.05.003
Angrist, Joshua and Jorn-Steffen Pischke. (2009) Mostly Harmless Econometrics. Princeton: Princeton University Press.
summary.RD
, plot.RD
, DCdensity
IKbandwidth
, kernelwts
, vcovHC
,
ivreg
, lm
x<-runif(1000,-1,1)
cov<-rnorm(1000)
y<-3+2*x+3*cov+10*(x>=0)+rnorm(1000)
RDestimate(y~x)
# Efficiency gains can be made by including covariates
RDestimate(y~x|cov)
Run the code above in your browser using DataLab