sigmaSvm | R Documentation |
Standard deviation is calculated using the first-stage bandwidth chosen by Silverman's Rule, as in RDHonest::NPRPrelimVar.fit.
sigmaSvm(Xt, Xc, Yt, Yc, t.dir = c("left", "right"))
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; |
This works only for cases with one-dimensional running variables.
a list containing conditional standard deviation estimates for treated
observations (sigma.t
) and control observations (sigma.c
)
X <- matrix(rnorm(500 * 1), nrow = 500, ncol = 1) tind <- X[, 1] < 0 Xt <- X[tind == 1, ,drop = FALSE] Xc <- X[tind == 0, ,drop = FALSE] sigma <- rep(1, 500) 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) sigmaSvm(Xt, Xc, Yt, Yc, "left")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.