sigmaNN | R Documentation |
Standard deviation is calculated by the formula (23) of Armstrong and Kolesár (2020)
sigmaNN(Xt, Xc, Yt, Yc, t.dir = c("left", "right"), N = 3)
Xt |
n_t by k design matrix for the treated units. |
Xc |
n_c by k design matrix for the control units. |
Yt |
outcome value for the treated group observations. |
Yc |
outcome value for the control group observations. |
t.dir |
treatment direction; |
N |
the number of nearest neighbors; default is |
For now, this function works only for one-dimensional cases.
a list containing conditional standard deviation estimates for treated
observations (sigma.t
) and control observations (sigma.c
)
Armstrong, Timothy B., and Michal Kolesár. 2020. "Simple and honest confidence intervals in nonparametric regression." Quantitative Economics 11 (1): 1–39.
n <- 500 d <- 1 X <- matrix(rnorm(n * d), nrow = n, ncol = d) tind <- X[, 1] < 0 Xt <- X[tind == 1, ,drop = FALSE] Xc <- X[tind == 0, ,drop = FALSE] sigma <- rnorm(n)^2 + 1 sigma_t <- sigma[tind == 1] sigma_c <- sigma[tind == 0] Yt = 1 + rnorm(length(sigma_t), mean = 0, sd = sigma_t) Yc = rnorm(length(sigma_c), mean = 0, sd = sigma_c) sigmaNN(Xt, Xc, Yt, Yc, t.dir = "left")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.