Skip to contents

Davison-Hinkley (1997): read the interval off the resampled ratios. Ratios are where the delta method quietly fails (skewness, small denominators, Fieller half-lines); the percentile interval needs none of that but inherits the caveat that a denominator resampling near zero produces wild replicates – the small-denominator fraction is reported. paired is a MODELLING statement: paired data resample as pairs to keep the dependence, independent samples separately, and getting it wrong biases the width in whichever direction the dependence points.

Usage

morie_bt_ci_ratio(
  x,
  y,
  stat_x = NULL,
  stat_y = NULL,
  B = 2000L,
  alpha = 0.05,
  seed = 0,
  paired = FALSE
)

Arguments

x, y

the two samples.

stat_x, stat_y

numerator and denominator statistics; the mean when NULL.

B

replicates, at least 100.

alpha

miss probability.

seed

resampling seed.

paired

resample pairs rather than independently.

Value

list: ratio, ci, replicates, se, small_denominator_fraction, paired, B, alpha, n_x, n_y, method.

References

Davison and Hinkley (1997), Bootstrap Methods and their Application, Chs. 2-3, 5; Fieller (1954).

Examples

set.seed(1)
morie_bt_ci_ratio(stats::rnorm(50, 2), stats::rnorm(50, 1),
  B = 200
)$ci
#> [1] 1.480625 2.428188