estimate_sigma: Estimate the Sigma Parameter for Regression Discontinuity...

Description Usage Arguments Details Value Examples

Description

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).

Usage

1
2
3
estimate_sigma(d_vec, w_vec, cutoff, lower = FALSE, init_sigma = NULL,
  method = c("tsgauss", "emparam"), x_dist = c("gauss"),
  u_dist = c("gauss", "lap"), ...)

Arguments

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 x < cutoff are assigned (i.e. d = 1). Otherwise those with x > cutoff are assigned.

init_sigma

initial value of sigma. If NULL (default), randomly chosen

method

character specifying the estimating method. "tsgauss" and "emparam" are supported

x_dist

distribution of the true running variable. Used only when method is "emparam". Currently, only "gauss" is supported.

u_dist

distribution of the measurement error. Used only when method is "emparam". Currently, "gauss" and "lap" are supported

...

additional controls. See tsgauss or emparam

Details

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.

Value

object of rddsigma class

Examples

 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)

kota7/rddsigma documentation built on May 20, 2019, 1:11 p.m.