ci_bc: Bias Corrected Confidence Intervals

Description Usage Arguments Value See Also Examples

View source: R/ci_misc.R

Description

Generates confidence intervals with bias-correction.

Usage

1
ci_bc(dist, est)

Arguments

dist

Sampling distribution of parameter estimate.

est

Parameter estimate.

Value

Returns a vector with the following elements:

se

Standard error.

z

z statistic.

p

p-value.

sig_001

Logical. Tests if p < 0.001.

sig_01

Logical. Tests if p < 0.01.

sig_05

Logical. Tests if p < 0.05.

ll_001

Lower limit. Alpha 0.001.

ll_01

Lower limit. Alpha 0.01.

ll_05

Lower limit. Alpha 0.05.

ul_05

Upper limit. Alpha 0.05.

ul_01

Upper limit. Alpha 0.01.

ul_001

Upper limit. Alpha 0.001.

zero_hit_001

Logical. Tests if ll_001 < 0 < ul_001.

zero_hit_01

Logical. Tests if ll_01 < 0 < ul_01.

zero_hit_05

Logical. Tests if ll_05 < 0 < ul_05.

ci_width_001

ll_001 - ul_001.

ci_width_01

ll_01 - ul_01.

ci_width_05

ll_05 - ul_05.

ci_shape_001

Confidence interval shape. Alpha 0.001.

ci_shape_01

Confidence interval shape. Alpha 0.01.

ci_shape_05

Confidence interval shape. Alpha 0.05.

Note that se, z, p, and sig are based on the normal theory. Confidence limits for ci_wald are based on the normal theory. Ajustments for asymmetry for ci_bc and ci_bca are made in the confidence limits.

See Also

Other confidence interval functions: ci_bca(), ci_quantile(), ci_wald()

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
B <- 5
Sigma <- matrix(
  data = c(
    225, 112.50, 56.25,
    112.5, 225, 112.5,
    56.25, 112.50, 225
  ),
  ncol = 3
)
data <- gendat_mvn(
  n = 100,
  Sigma = Sigma,
  mu = c(100, 100, 100)
)
est <- med_simple(data = data, minimal = TRUE)
boot_nb_resamples <- boot_nb(data = data, B = B)
nb <- boot_fit(boot_resamples = boot_nb_resamples, fitFUN = med_simple, minimal = TRUE)
n <- nrow(data)
est_Sigma <- cov(data)
est_mu <- colMeans(data)
boot_pb_resamples <- boot_pb(n = n, Sigma = est_Sigma, mu = est_mu, B = B)
pb <- boot_fit(boot_resamples = boot_pb_resamples, fitFUN = med_simple, minimal = TRUE)
nb_ci_bc <- ci_bc(dist = nb, est = est)
pb_ci_bc <- ci_bc(dist = pb, est = est)

jeksterslabds/jeksterslabRds documentation built on July 16, 2020, 3:41 p.m.