RDestimate: Regression Discontinuity Estimation

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/RDestimate.R

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

1
2
3
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 is the running variable, and z is the endogenous treatment variable. Covariates are then included in the same manner as in a sharp RDD.

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 only a single value is passed into the function, the RD will similarly be estimated at that bandwidth, half that bandwidth, and twice that bandwidth.

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 "rectangular", "epanechnikov", "quartic", "triweight", "tricube", "gaussian" and "cosine".

se.type

this specifies the robust SE calculation method to use. Options are, as in vcovHC, "HC3", "const", "HC", "HC0", "HC1", "HC2", "HC4", "HC4m", "HC5". This option is overriden by cluster.

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 discrete running variable be clustered by each unique value of the running variable (Lee and Card 2008).

verbose

will provide some additional information printed to the terminal.

model

logical. If TRUE, the model object will be returned.

frame

logical. If TRUE, the data frame used in model fitting will be returned.

Details

Covariates are problematic for inclusion in the regression discontinuity design. This package allows their inclusion, but cautions against them insomuch as is possible. When covariates are included in the specification, they are simply included as exogenous regressors. In the sharp design, this means they are simply added into the regression equation, uninteracted with treatment. Likewise for the fuzzy design, in which they are added as regressors in both stages of estimation.

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:

type

a string denoting either "sharp" or "fuzzy" RDD.

est

numeric 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

se

numeric vector of the standard error for each corresponding bandwidth

z

numeric vector of the z statistic for each corresponding bandwidth

p

numeric vector of the p value for each corresponding bandwidth

ci

the matrix of the 95 for each corresponding bandwidth

bw

numeric vector of each bandwidth used in estimation

obs

vector of the number of observations within the corresponding bandwidth

call

the matched call

na.action

the 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.

Author(s)

Drew Dimmery <drewd@nyu.edu>

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

1
2
3
4
5
6
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)

Example output

Loading required package: sandwich
Loading required package: lmtest
Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

Loading required package: AER
Loading required package: car
Loading required package: survival
Loading required package: Formula

Call:
RDestimate(formula = y ~ x)

Coefficients:
     LATE    Half-BW  Double-BW  
   10.193      9.981     10.035  


Call:
RDestimate(formula = y ~ x | cov)

Coefficients:
     LATE    Half-BW  Double-BW  
    10.10      10.15       9.99  

rdd documentation built on May 2, 2019, 10:22 a.m.