Description Usage Arguments Value Examples
This function computes the local composite quantile regression estimate with covariates. The point of interest can be either interior or boundary.
1 | cqrMMxcv(x0, x_vec, y, xcv, kernID, tau, h, p, maxit = 100L, tol = 1e-04)
|
x0 |
point of interest |
x_vec |
a vector of covariates |
y |
a vector of dependent variable, the treatment outcome variable in the case of regression discontinuity. |
xcv |
A matrix of additional covariates to be used in local regression analysis.
It must have the same number of rows as the running variable |
kernID |
kernel ID for different kernels.
|
tau |
A vector of quantile positions. They are obtained by
|
h |
A scalar bandwidth. |
p |
The polynomial degree. |
maxit |
Maximum iteration number in the MM algorithm for quantile estimation. |
tol |
Convergence criterion in the MM algorithm. |
cqrMMxcv
returns a list with the following components:
beta0 |
A q by 1 vector of estimates for q quantiles. |
beta1 |
A p by 1 vector of estimates for the first p derivatives of the conditional mean function. |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | # Use the Head Start data as an example.
data(headstart)
data_n = subset(headstart, headstart$poverty < 0)
q = 5
tau = (1:q) / (q + 1)
# Compute the local composite quantile estimate
est = cqrMMxcv(x0 = 0,
x_vec = data_n$poverty,
y = data_n$mortality,
xcv = matrix(0,2,2),
kernID = 2,
tau = tau,
h = 4.0,
p = 1,
maxit = 10,
tol = 1.0e-3)
# Estimate of the conditional mean on the boundary
est_mean = mean(est$beta0)
# Estimate of the first derivative of the conditional mean function
est_d1 = est$beta1[1]
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.