ExpandProbs: Calculate modified probabilities for more accurate confidence...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/limits.R

Description

Compute modified quantiles levels, for more accurate confidence intervals. Using these levels gives sider intervals, with closer to desired coverage.

Usage

1
ExpandProbs(probs, n)

Arguments

probs

vector of numerical values between 0 and 1.

n

number of observations.

Details

Bootstrap percentile confidence interval for a sample mean correspond roughly to

xbar +- z_alpha sigmaHat

instead of

xbar +- t_alpha,n-1 s

where

sigmaHat = sqrt((n-1)/n) s

is like s but computed using a divisor of n instead of n-1. Similarly for other statistics, the bootstrap percentile interval is too narrow, typically by roughly the same proportion.

This function finds modified probability levels probs2, such that

z_{\mbox{probs2}} √{(n-1)/n} = t_{\mbox{probs}, n-1}

z_probs2 sqrt((n-1)/n) = t_probs,n-1 so that for symmetric data, the bootstrap percentile interval approximately matches the usual $t$ confidence interval.

Value

A vector like probs, but with values closer to 0 and 1.

Author(s)

Tim Hesterberg timhesterberg@gmail.com,
http://www.timhesterberg.net/bootstrap

References

This discusses the expanded percentile interval: Hesterberg, Tim (2014), What Teachers Should Know about the Bootstrap: Resampling in the Undergraduate Statistics Curriculum, http://arxiv.org/abs/1411.5279.

See Also

CI.percentile, CI.bca,

Examples

1
2
3
probs <- c(0.025, 0.975)
n <- c(5, 10, 20, 40, 100, 200, 1000)
outer(probs, n, ExpandProbs)

Example output

             [,1]        [,2]       [,3]       [,4]       [,5]       [,6]
[1,] 0.0009541006 0.008550639 0.01588083 0.02025754 0.02306439 0.02402618
[2,] 0.9990458994 0.991449361 0.98411917 0.97974246 0.97693561 0.97597382
           [,7]
[1,] 0.02480431
[2,] 0.97519569

resample documentation built on May 2, 2019, 9:26 a.m.