
Last chance! 50% off unlimited learning
Sale ends in
rd_impute
estimates treatment effects in an RDD with imputed missing values.
rd_impute(
formula,
data,
subset = NULL,
cutpoint = NULL,
bw = NULL,
kernel = "triangular",
se.type = "HC1",
cluster = NULL,
impute = NULL,
verbose = FALSE,
less = FALSE,
est.cov = FALSE,
est.itt = FALSE,
t.design = NULL
)
rd_impute
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:
The matched call.
A logical value indicating whether multiple imputation is used or not.
A string denoting either "sharp"
or "fuzzy"
RDD.
The names of covariates.
Numeric vector of each bandwidth used in estimation.
Vector of the number of observations within the corresponding bandwidth.
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 parametric and non-parametric case and corresponding bandwidth.
Returns the model frame used in fitting.
The observations removed from fitting due to missingness.
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.
Numeric vector of the effect size (Cohen's d) for each estimate.
Numeric vector of the standard error for each corresponding bandwidth.
Numeric vector of the z statistic for each corresponding bandwidth.
Numeric vector of the degrees of freedom computed using Barnard and Rubin (1999) adjustment for imputation.
Numeric vector of the p-value for each corresponding bandwidth.
The matrix of the 95 for each corresponding bandwidth.
The formula of the RDD; a symbolic description of the model to be fitted. 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. A fuzzy RDD may be specified as
y ~ x + z
where x
is the running variable, and
z
is the endogenous treatment variable. Covariates are included in the
same manner as in a sharp RDD.
An optional data frame containing the variables in the model. If not found in data
,
the variables are taken from environment(formula)
.
An optional vector specifying a subset of observations to be used in the fitting process.
A numeric value containing the cutpoint at which assignment to the treatment is determined. The default is 0.
A vector specifying the bandwidths at which to estimate the RD.
Possible values are "IK09"
, "IK12"
, and a user-specified non-negative numeric vector specifying the bandwidths at which to estimate the RD.
The default is "IK12"
. If bw
is "IK12"
, the bandwidth is calculated using the Imbens-Kalyanaraman
2012 method. If bw
is "IK09"
, the bandwidth is calculated using
the Imbens-Kalyanaraman 2009 method. Then the RD is 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.
A string indicating which kernel to use. Options are "triangular"
(default and recommended), "rectangular"
, "epanechnikov"
, "quartic"
,
"triweight"
, "tricube"
, and "cosine"
.
This specifies the robust standard error calculation method to use,
from the "sandwich" package. Options are,
as in vcovHC
, "HC3"
, "const"
, "HC"
, "HC0"
,
"HC1"
, "HC2"
, "HC4"
, "HC4m"
, "HC5"
. This option
is overridden by 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).
An optional vector of length n, indexing whole imputations.
A logical value indicating whether to print additional information to
the terminal. The default is FALSE
.
Logical. If TRUE
, return the estimates of linear and optimal. If FALSE
return the estimates of linear, quadratic, cubic, optimal, half and double. The default is FALSE
.
Logical. If TRUE
, the estimates of covariates will be included.
If FALSE
, the estimates of covariates will not be included. The default is FALSE
. This option is not
applicable if method is "front"
.
Logical. If TRUE
, the estimates of ITT will be returned.
If FALSE
, the estimates of ITT will not be returned. The default is FALSE
. This option is not
applicable if method is "front"
.
A string specifying the treatment option according to design.
Options are "g"
(treatment is assigned if x
is greater than its cutoff),
"geq"
(treatment is assigned if x
is greater than or equal to its cutoff),
"l"
(treatment is assigned if x
is less than its cutoff),
and "leq"
(treatment is assigned if x
is less than or equal to its cutoff).
Lee, D. S., Card, D. (2010). Regression discontinuity inference with specification error. Journal of Econometrics, 142(2), 655-674. tools:::Rd_expr_doi("10.1016/j.jeconom.2007.05.003").
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.
Barnard, J., Rubin, D. (1999). Small-Sample Degrees of Freedom with Multiple Imputation. Biometrika, 86(4), 948-55.
set.seed(12345)
x <- runif(1000, -1, 1)
cov <- rnorm(1000)
y <- 3 + 2 * x + 3 * cov + 10 * (x < 0) + rnorm(1000)
group <- rep(1:10, each = 100)
rd_impute(y ~ x, impute = group, t.design = "l")
# Efficiency gains can be made by including covariates (review SEs in "summary" output).
rd_impute(y ~ x | cov, impute = group, t.design = "l")
Run the code above in your browser using DataLab