Learn R Programming

rdd (version 0.50)

RDestimate: Regression Discontinuity Estimation

Description

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.

Usage

RDestimate(formula, data, subset = NULL, cutpoint = NULL,
    bw = NULL, kernel = "triangular", se.type = "HC1",
    cluster = NULL, verbose = FALSE, model = FALSE,
    frame = FALSE)

Arguments

formula
the formula of the RDD. This is supplied in the format of 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
data
an optional data frame
subset
an optional vector specifying a subset of observations to be used
cutpoint
the cutpoint. If omitted, it is assumed to be 0.
bw
the bandwidth. If omitted, it is calculated using the Imbens-Kalyanaraman method.
kernel
a string specifying the kernel to be used in the local linear fitting. "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 <
se.type
this specifies the robust SE calculation method to use. Options are, as in vcovHC, "HC3", "const", "HC", "HC0", "HC1", "HC2"
cluster
an optional vector specifying clusters within which the errors are assumed to be correlated. This will result in reporting cluster robust SEs. This option overrides anything specified in se.type. It is suggested that data with a d
verbose
will provide some additional information printed to the terminal.
frame
logical. If TRUE, the data frame used in model fitting will be returned.
model
logical. If TRUE, the model object will be returned.

Value

  • 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:
  • typea string denoting either "sharp" or "fuzzy" RDD.
  • estthe estimate of the discontinuity in the outcome under a sharp design, or the Wald estimator in the fuzzy design
  • sethe standard error
  • zthe z statistic
  • pthe p value
  • cithe vector of the 95 interval, c("CI Lower Bound","CI Upper Bound")
  • bwthe bandwidth
  • callthe matched call
  • na.actionthe observations removed from fitting due to missingness
  • model(if requested) For a sharp design, the lm object is returned. For a fuzzy design, a list is returned with two elements: firststage, the first stage lm object, and iv, the ivreg object.
  • frame(if requested) Returns the model frame used in fitting.

References

Lee, David and Thomas Lemieux. (2010) "Regression Discontinuity Designs in Economics," Journal of Economic Literature. 48(2): 281-355. http://www.aeaweb.org/articles.php?doi=10.1257/jel.48.2.281 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.

See Also

summary.RD, plot.RD, DCdensity IKbandwidth, kernelwts, vcovHC, ivreg, lm

Examples

Run this code
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