CI_minimax_RD: Minimax Confidence Interval

View source: R/CI_mm.R

CI_minimax_RDR Documentation

Minimax Confidence Interval

Description

Calculates the minimax confidence interval.

Usage

CI_minimax_RD(
  Yt,
  Yc,
  Xt,
  Xc,
  C_max,
  mon_ind,
  se.method = c("nn", "supplied", "nn.test"),
  se.init = c("Silverman", "nn", "supplied", "supp.sep", "S.test"),
  t.dir = c("left", "right"),
  alpha,
  N = 3,
  sigma_t,
  sigma_c,
  sigma_t.init,
  sigma_c.init,
  opt_b = NULL,
  min_half_length = NULL,
  maxb.const = 10,
  Prov.Plot = FALSE,
  len.return = FALSE
)

Arguments

Yt

outcome value for the treated group observations.

Yc

outcome value for the control group observations.

Xt

n_t by k design matrix for the treated units.

Xc

n_c by k design matrix for the control units.

C_max

the worst-case smoothness parameter.

mon_ind

index number for monotone variables.

se.method

the standard deviation estimation method.

se.init

the standard deviation estimation method for choosing an optimal estimator.

t.dir

treatment direction; t.dir = "left" if x < 0 is treated. Otherwise, t.dir = "right". This should specified only for one-dimensional cases.

alpha

the desired level of non-coverage

N

the number of neighbors to be used when se.method = "nn"; the default is N = 3.

sigma_t

supplied variance for treated observations.

sigma_c

supplied variance for control observations.

sigma_t.init

supplied first-stage variance for treated observations.

sigma_c.init

supplied first-stage variance for control observations.

opt_b

provided if the optimal modulus value is known; ' default is NULL.

min_half_length

provided if the optimal half-length is known; default is NULL.

maxb.const

governs the optimization range; default is 10.

Prov.Plot

if TRUE, provides a plot that can be used to check the optimization worked well; default is FALSE.

len.return

if TRUE, returns only the optimal half-length; default is FALSE.

Details

So far, conditional variance estimation works only for one-dimensional case.

Value

returns a list with the confidence interval (ci), the standard deviation #' of the estimator (sd), and the bandwidths used for the treated observations and the control observations (h.t and h.c)

Examples

n <- 500
d <- 2
X <- matrix(rnorm(n * d), nrow = n, ncol = d)
tind <- X[, 1] > 0 & X[, 2] > 0
Xt <- X[tind == 1, ,drop = FALSE]
Xc <- X[tind == 0, ,drop = FALSE]
mon_ind <- c(1, 2)
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)
C_max <- 1
CI_minimax_RD(Yt, Yc, Xt, Xc, C_max, mon_ind, "nn.test", "S.test", alpha = 0.05)
d <- 1
X <- rnorm(n)
tind <- X < 0
Xt <- X[tind == 1]
Xc <- X[tind == 0]
mon_ind <- 1
sigma <- rep(1, n)
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)
CI_minimax_RD(Yt, Yc, Xt, Xc, C_max, mon_ind, "nn", "Silverman", t.dir = "left",
alpha = 0.05)
CI_minimax_RD(Yt, Yc, Xt, Xc, C_max, mon_ind, "nn", "nn", t.dir = "left",
alpha = 0.05)

koohyun-kwon/rdadapt documentation built on May 8, 2022, 8:49 p.m.