rd_est | R Documentation |
rd_est
estimates both sharp and fuzzy RDDs using parametric and non-parametric
(local linear) models.
It is based on the RDestimate
function in the "rdd" package.
Sharp RDDs (both parametric and non-parametric) are estimated using lm
in the
stats package.
Fuzzy RDDs (both parametric and non-parametric) are estimated using two-stage least-squares
ivreg
in the AER package.
For non-parametric models, Imbens-Kalyanaraman optimal bandwidths can be used,
rd_est(
formula,
data,
subset = NULL,
cutpoint = NULL,
bw = NULL,
kernel = "triangular",
se.type = "HC1",
cluster = NULL,
verbose = FALSE,
less = FALSE,
est.cov = FALSE,
est.itt = FALSE,
t.design = NULL
)
formula |
The formula of the RDD; a symbolic description of the model to be fitted. This is supplied in the
format of |
data |
An optional data frame containing the variables in the model. If not found in |
subset |
An optional vector specifying a subset of observations to be used in the fitting process. |
cutpoint |
A numeric value containing the cutpoint at which assignment to the treatment is determined. The default is 0. |
bw |
A vector specifying the bandwidths at which to estimate the RD.
Possible values are |
kernel |
A string indicating which kernel to use. Options are |
se.type |
This specifies the robust standard error calculation method to use,
from the "sandwich" package. Options are,
as in |
cluster |
An optional vector of length n 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 |
verbose |
A logical value indicating whether to print additional information to
the terminal. The default is |
less |
Logical. If |
est.cov |
Logical. If |
est.itt |
Logical. If |
t.design |
A string specifying the treatment option according to design.
Options are |
rd_est
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 |
est |
Numeric vector of the estimate of the discontinuity in the outcome under a sharp RDD or the Wald estimator in the fuzzy RDD, 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. |
d |
Numeric vector of the effect size (Cohen's d) for each estimate. |
cov |
The names of covariates. |
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 number of observations removed from fitting due to missingness. |
impute |
A logical value indicating whether multiple imputation is used or not. |
model |
For a sharp design, a list of the |
frame |
Returns the dataframe used in fitting the model. |
Lee, D. S., Lemieux, T. (2010). Regression Discontinuity Designs in Economics. Journal of Economic Literature, 48(2), 281-355. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1257/jel.48.2.281")}.
Imbens, G., Lemieux, T. (2008). Regression discontinuity designs: A guide to practice. Journal of Econometrics, 142(2), 615-635. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2007.05.001")}.
Lee, D. S., Card, D. (2010). Regression discontinuity inference with specification error. Journal of Econometrics, 142(2), 655-674. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1016/j.jeconom.2007.05.003")}.
Angrist, J. D., Pischke, J.-S. (2009). Mostly harmless econometrics: An empiricist's companion. Princeton, NJ: Princeton University Press.
Drew Dimmery (2016). rdd: Regression Discontinuity Estimation. R package version 0.57. https://CRAN.R-project.org/package=rdd
Imbens, G., Kalyanaraman, K. (2009). Optimal bandwidth choice for the regression discontinuity estimator (Working Paper No. 14726). National Bureau of Economic Research. https://www.nber.org/papers/w14726.
Imbens, G., Kalyanaraman, K. (2012). Optimal bandwidth choice for the regression discontinuity estimator. The Review of Economic Studies, 79(3), 933-959. https://academic.oup.com/restud/article/79/3/933/1533189.
set.seed(12345)
x <- runif(1000, -1, 1)
cov <- rnorm(1000)
y <- 3 + 2 * x + 3 * cov + 10 * (x >= 0) + rnorm(1000)
rd_est(y ~ x, t.design = "geq")
# Efficiency gains can be made by including covariates (review SEs in "summary" output).
rd_est(y ~ x | cov, t.design = "geq")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.