Skip to contents

Required wherever a denominator is small enough that the normal approximation misbehaves – a clinician-interview subset, for instance. Slower than wilson_ci because it calls [stats::binom.test()] per row.

Usage

exact_ci(x, n, conf_level = 0.95)

Arguments

x

Number of successes. Vectorised.

n

Number of trials. Vectorised.

conf_level

Confidence level.

Value

A two-column matrix with columns lo and hi, on the 0-1 scale.

Examples

exact_ci(2, 6)
#>              lo        hi
#> [1,] 0.04327187 0.7772219