adpt.res.gen: Length Generation for One-sided CIs

View source: R/MCres_comb.R

adpt.res.genR Documentation

Length Generation for One-sided CIs

Description

Calculate excess lengths of one-sided CIs for different values of true Lipschitz coefficients.

Usage

adpt.res.gen(
  eps,
  CI.method,
  th,
  spec.etc,
  which.fun,
  n,
  sig.scale,
  which.spec = 1
)

Arguments

eps

N(0,1) random noises.

CI.method

method to be used to generate the CI.

th

true RD parameter value.

spec.etc

list of other specification parameters.

which.fun

which regression function to evaluate; supports 1:6.

n

sample size.

sig.scale

scaling parameter for the standard deviation.

which.spec

which design is used; the default is which.spec = 1.

Details

Modification for multi-dim hasn't been made yet.

Value

vector of excess lengths and coverage indicators corresponding to true Lipschitz coefficient values contained in spec.etc$C.true.vec.

Examples

spec.etc <- list(alpha = 0.05, mon_ind = 1,
C.small = 1, C.large = 3, se.method.RDH = "nn", se.initial.RDH = "nn", M.RDH = 1,
se.method = "nn", se.init = "Silverman", t.dir = "left", C.l = 1/2, C.u = 2, C = 3,
C.true.vec = seq(1/2, 3, length.out = 2), adpt.orc = TRUE)
n <- 100
th <- 1
eps <- rnorm(n)
which.fun <- 1
sig.scale <- 1/2
CI.method <- "adpt.one"
adpt.res.gen(eps, CI.method, th, spec.etc, which.fun, n, sig.scale)
spec.etc$adpt.orc <- FALSE
adpt.res.gen(eps, CI.method, th, spec.etc, which.fun, n, sig.scale)

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