Skip to main content

dunnett_confidence_interval

Function dunnett_confidence_interval 

Source
pub fn dunnett_confidence_interval<U: UniformGenerator>(
    samples: &[&[f64]],
    control: &[f64],
    alternative: DunnettAlternative,
    confidence_level: f64,
    rng: &mut U,
) -> Result<Vec<(f64, f64)>, ErrorsJSL>
Expand description

Simultaneous confidence intervals for the differences of the treatment means and the control mean (SciPy’s DunnettResult.confidence_interval): x̄ᵢ − x̄₀ ± c s √(1/nᵢ + 1/n₀) for the two-sided alternative, with (−∞, … + …] and [… − …, ∞) for the one-sided ones, where c is the critical value of Dunnett’s test at the level 1 − confidence_level: the c for which the probability that the largest (absolute) statistic exceeds it is 1 − confidence_level.

c is found by bisection on that probability. The probability is a quasi-Monte Carlo estimate, noisy from one evaluation to the next, so every evaluation reuses one stream of random shifts (a seed drawn from rng), which makes it a smooth function of c. Returns, for each treatment, the interval (low, high).