Learn R Programming

rdd (version 0.52)

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
a numeric vector specifying the bandwidths at which to estimate the RD. If omitted, the bandwidth is calculated using the Imbens-Kalyanaraman method, and then estimated with that bandwidth, half that bandwidth, and twice that bandwidth. If onl
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.
  • estnumeric vector of the estimate of the discontinuity in the outcome under a sharp design, or the Wald estimator in the fuzzy design for each corresponding bandwidth
  • senumeric vector of the standard error for each corresponding bandwidth
  • znumeric vector of the z statistic for each corresponding bandwidth
  • pnumeric vector of the p value for each corresponding bandwidth
  • cithe matrix of the 95 c("CI Lower Bound","CI Upper Bound") for each corresponding bandwidth
  • bwnumeric vector of each bandwidth used in estimation
  • obsvector of the number of observations within the corresponding bandwidth
  • callthe matched call
  • na.actionthe observations removed from fitting due to missingness
  • model(if requested) For a sharp design, a list of the 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.
  • 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