rdd_reg_lm: Parametric polynomial estimator of the regression...

Description Usage Arguments Details Value Examples

View source: R/reg_lm.R

Description

Compute a parametric polynomial regression of the ATE, possibly on the range specified by bandwidth

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
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
)

Arguments

rdd_object

Object of class rdd_data created by rdd_data

covariates

Formula to include covariates

order

Order of the polynomial regression.

bw

A bandwidth to specify the subset on which the parametric regression is estimated

slope

Whether slopes should be different on left or right (separate), or the same.

covar.opt

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).

covar.strat

DEPRECATED, use covar.opt instead.

weights

Optional weights to pass to the lm function. Note this cannot be entered together with bw

Details

This function estimates the standard discontinuity regression:

Y=α+τ D+β_{1}(X-c)+β_{2}D(X-c)+ε

with τ the main parameter of interest. Several versions of the regression can be estimated, either restricting the slopes to be the same, i.e β_{1}=β_{2} (argument slope). The order of the polynomial in X-c can also be adjusted with argument 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:

include

Covariates are simply added as supplementary regressors in the RD equation

residual

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.

Value

An object of class rdd_reg_lm and class lm, with specific print and plot methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## 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)

rddtools documentation built on Jan. 10, 2022, 5:07 p.m.