Last data update: 2014.03.03
|
R: Plot the sensitivity to the bandwidth
Plot the sensitivity to the bandwidth
Description
Draw a plot showing the LATE estimates depending on multiple bandwidths
Usage
plotSensi(rdd_regobject, from, to, by = 0.01, level = 0.95,
output = c("data", "ggplot"), plot = TRUE, ...)
## S3 method for class 'rdd_reg_np'
plotSensi(rdd_regobject, from, to, by = 0.05,
level = 0.95, output = c("data", "ggplot"), plot = TRUE,
device = c("ggplot", "base"), vcov. = NULL, ...)
## S3 method for class 'rdd_reg_lm'
plotSensi(rdd_regobject, from, to, by = 0.05,
level = 0.95, output = c("data", "ggplot"), plot = TRUE, order,
type = c("colour", "facet"), ...)
Arguments
rdd_regobject |
object of a RDD regression, from either rdd_reg_lm or rdd_reg_np
|
from |
First bandwidth point. Default value is max(1e-3, bw-0.1)
|
to |
Last bandwidth point. Default value is bw+0.1
|
by |
Increments in the from to sequence
|
level |
Level of the confidence interval
|
output |
Whether to return (invisibly) the data frame containing the bandwidths and corresponding estimates, or the ggplot object
|
plot |
Whether to actually plot the data.
|
device |
Whether to draw a base or a ggplot graph.
|
vcov. |
Specific covariance function to pass to coeftest. See help of package sandwich
|
order |
For parametric models (from rdd_reg_lm ), the order of the polynomial.
|
type |
For parametric models (from rdd_reg_lm ) whether different orders are represented as different colour or as different facets.
|
... |
Further arguments passed to specific methods
|
Value
A data frame containing the bandwidths and corresponding estimates and confidence intervals.
Author(s)
Matthieu Stigler <Matthieu.Stigler@gmail.com>
Examples
data(house)
house_rdd <- rdd_data(y=house$y, x=house$x, cutpoint=0)
#Non-parametric estimate
bw_ik <- rdd_bw_ik(house_rdd)
reg_nonpara <- rdd_reg_np(rdd_object=house_rdd, bw=bw_ik)
plotSensi(reg_nonpara)
plotSensi(reg_nonpara, device='base')
#Parametric estimate:
reg_para_ik <- rdd_reg_lm(rdd_object=house_rdd, order=4, bw=bw_ik)
plotSensi(reg_para_ik)
plotSensi(reg_para_ik, type='facet')
Results
|