Description Usage Arguments Details Value Examples
This function provides a high level API for estimating the sigma parameter (the standard deviation of the measurement error in running variables of sharp regression discontinuity designs).
1 2 3 |
d_vec |
binary integer vector of treetment assingment |
w_vec |
numeric vector of observed running variable |
cutoff |
threshold value for assignment |
lower |
if TRUE, then those with |
init_sigma |
initial value of sigma. If NULL (default), randomly chosen |
method |
character specifying the estimating method.
|
x_dist |
distribution of the true running variable.
Used only when |
u_dist |
distribution of the measurement error.
Used only when |
... |
additional controls. See |
The method "tsgauss"
estimates the sigma parameter under the
assumption that the true running variable and the measurement error are Gaussian.
The method "emparam"
relaxes this assumption and allows them to follow
some parametric distributions. Currently, this function supports the Gaussian
distribution for the running variable and the Gaussian and Laplace distributions
for the measurement error.
object of rddsigma
class
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
set.seed(123)
dat <- gen_data(500, 0.2, 0)
# gaussian-gaussian model
estimate_sigma(dat$d, dat$w, 0, method="tsgauss")
# em algorithm estimator with parameteric assumptions
estimate_sigma(dat$d, dat$w, 0, method="emparam",
x_dist="gauss", u_dist="gauss", verbose=TRUE)
estimate_sigma(dat$d, dat$w, 0, method="emparam",
x_dist="gauss", u_dist="lap", verbose=TRUE)
# experiment with lower=TRUE
dat <- gen_data(500, 0.5, 1, lower=TRUE)
estimate_sigma(dat$d, dat$w, 1, lower=TRUE, method="tsgauss")
estimate_sigma(dat$d, dat$w, 1, lower=TRUE, method="emparam",
x_dist="gauss", u_dist="gauss", verbose=TRUE)
estimate_sigma(dat$d, dat$w, 1, lower=TRUE, method="emparam",
x_dist="gauss", u_dist="lap", verbose=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.