RDestimate supports both sharp and fuzzy RDD
utilizing the 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"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 <vcovHC,
"HC3", "const", "HC", "HC0",
"HC1", "HC2"se.type. It
is suggested that data with a dTRUE, the data frame used
in model fitting will be returned.TRUE, the model object
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.c("CI Lower Bound","CI Upper Bound") for each
corresponding bandwidthlm 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.summary.RD, plot.RD,
DCdensity IKbandwidth,
kernelwts, vcovHC,
ivreg, lmx<-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