Compute a parametric polynomial regression of the ATE, possibly on the range specified by bandwidth
rdd_reg_lm(
rdd_object,
covariates = NULL,
order = 1,
bw = NULL,
slope = c("separate", "same"),
covar.opt = list(strategy = c("include", "residual"), slope = c("same", "separate"),
bw = NULL),
covar.strat = c("include", "residual"),
weights
)
Object of class rdd_data created by rdd_data
Formula to include covariates
Order of the polynomial regression.
A bandwidth to specify the subset on which the parametric regression is estimated
Whether slopes should be different on left or right (separate), or the same.
Options for the inclusion of covariates. Way to include covariates, either in the main regression (include
) or as regressors of y in a first step (residual
).
DEPRECATED, use covar.opt instead.
Optional weights to pass to the lm function. Note this cannot be entered together with bw
An object of class rdd_reg_lm and class lm, with specific print and plot methods
This function estimates the standard discontinuity regression:
slope
). The order of the polynomial in order
.
Note that a value of zero can be used, which corresponds to the simple difference in means, that one would use if the samples were random.
Covariates can also be added in the regression, according to the two strategies discussed in Lee and Lemieux (2010, sec 4.5), through argument covar.strat
:
Covariates are simply added as supplementary regressors in the RD equation
The dependent variable is first regressed on the covariates only, then the RDD equation is applied on the residuals from this first step
The regression can also be estimated in a neighborhood of the cutpoint with the argument bw
. This make the parametric regression resemble
the non-parametric local kernel rdd_reg_np
. Similarly, weights can also be provided (but not simultaneously to bw
).
The returned object is a classical lm
object, augmented with a RDDslot
, so usual methods can be applied. As is done in general in R,
heteroskeadsticity-robust inference can be done later on with the usual function from package sandwich. For the case of clustered observations
a specific function clusterInf
is provided.
# NOT RUN {
## Step 0: prepare data
data(house)
house_rdd <- rdd_data(y=house$y, x=house$x, cutpoint=0)
## Step 2: regression
# Simple polynomial of order 1:
reg_para <- rdd_reg_lm(rdd_object=house_rdd)
print(reg_para)
plot(reg_para)
# Simple polynomial of order 4:
reg_para4 <- rdd_reg_lm(rdd_object=house_rdd, order=4)
reg_para4
plot(reg_para4)
# Restrict sample to bandwidth area:
bw_ik <- rdd_bw_ik(house_rdd)
reg_para_ik <- rdd_reg_lm(rdd_object=house_rdd, bw=bw_ik, order=4)
reg_para_ik
plot(reg_para_ik)
# }
Run the code above in your browser using DataLab