rd_impute
estimates treatment effects in a 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)
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.
An optional data frame.
An optional vector specifying a subset of observations to be used
The cutpoint. If omitted, it is assumed to be 0.
A numeric vector specifying the bandwidths at which to estimate the RD.
If omitted or it is "IK12"
, the bandwidth is calculated using the Imbens-Kalyanaraman
2012 method. If it is "IK09"
, the bandwidth is calculated using
the Imbens-Kalyanaraman 2009 method. Then it 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 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"
.
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 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 specifying the imputed variables with missing values.
Will provide some additional information printed to the terminal.
Logical. If TRUE
, return the estimates of linear and optimal,
instead of linear, quadratic, cubic, optimal, half and double.
Logical. If TRUE
, the estimates of covariates will be included.
Logical. If TRUE
, the estimates of ITT will be returned.
The treatment option according to design.
The entry is for X: "g"
means treatment is assigned
if X is greater than its cutoff, "geq"
means treatment is assigned
if X is greater than or equal to its cutoff, "l"
means treatment is assigned
if X is less than its cutoff, "leq"
means treatment is assigned
if X is less than or equal to its cutoff.
rd_impute
returns an object of class "rd
".
Stata: 64 mi estimate - Estimation using multiple imputations
# NOT RUN {
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
rd_impute(y ~ x | cov, impute = group, t.design = "l")
# }
Run the code above in your browser using DataCamp Workspace