Description Usage Arguments Value References Examples
This function computes variance and adjusted variance on the boundary for a sharp RD using the local composite quantile regression method. It also returns several other quantities that will be used in computing the variance in a fuzzy RD.
1 2 | boundary_var(dat, kernID = 0, left = TRUE, maxit = 100, tol = 1.0e-4,
para = 1, grainsize = 1, llr.residuals = TRUE, ls.derivative = TRUE)
|
dat |
A list with the following components:
|
kernID |
Kernel id number. Defaults to 0.
|
left |
A logical variable that takes the value |
maxit |
Maximum iteration number in the MM algorithm for quantile estimation. Defaults to 100. |
tol |
Convergence criterion in the MM algorithm. Defaults to 1.0e-4. |
para |
A 0/1 variable specifying whether to use parallel computing. Defaults to 1. |
grainsize |
Minimum chunk size for parallelization. Defaults to 1. |
llr.residuals |
Whether to use residuals from the local linear
regression as the input to compute the LCQR standard errors and the
corresponding bandwidths. Defaults to |
ls.derivative |
Whether to use a global quartic and quintic polynomial to
estimate the second and third derivatives of the conditional mean function.
Defaults to |
boundary_var
returns a list with the following components:
var |
Estimated variance on the boundary. |
var_adj |
Adjusted variance estimate on the boundary. |
e_hat |
Residuals adjusted by the estimated standard deviations. |
ss_0 |
The S matrix in Huang and Zhan (2021) when the degree of the polynomial in estimation is equal to 1. |
ss_1 |
The S matrix in Huang and Zhan (2021) when the degree of the polynomial in estimation is equal to 2. |
sig0_hat |
Estimated conditional standard deviation at the cutoff 0. |
var_bias |
Estimated variance of the bias. |
var_cov |
Estimated covariance between the conditional mean and its bias. |
ac |
The constant in the bias expression. |
bias_fixedn |
The bias based on fixed-n approximation. |
There are also several returned values with suffix "fixedn", which are the counterparts of the above values based on the fixed-n approximation.
Huang and Zhan (2021) "Local Composite Quantile Regression for Regression Discontinuity," working paper.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ## Not run:
# Use the headstart data.
data(headstart)
data_p = subset(headstart, headstart$poverty > 0)
p = 1
q = 5
tau = (1:q) / (q + 1)
h_d0 = ks::hns(x, deriv.order = 0)
f0_hat = ks::kdde(x, h = h_d0, deriv.order = 0, eval.points = c(0))$estimate
h_d1 = ks::hns(x, deriv.order = 1)
fd1 = ks::kdde(x, h = h_d1, deriv.order = 1, eval.points = c(0))$estimate
# Set up the list to be passed to the boundary_var function.
# Supply a bandwidth equal to 2.0.
dat_p = list("x" = data_p$poverty,
"y" = data_p$mortality,
"q" = q,
"h" = 2.0,
"tau" = tau,
"p" = p,
"n_all" = n_all,
"f0_hat" = f0_hat,
"fd1" = fd1)
# Use the residuals from local linear regression for a quick try.
boundary_var(dat = dat_p, left = FALSE, llr.residuals = TRUE, ls.derivative = TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.