ciUtils {Rariant} | R Documentation |
Utility functions to find confidence intervals that (a) overlap a certain value ('ciOutside', 'ciCovers') and (b) different confidence intervals overlap ('ciOverlap').
ciOutside(x, delta = 0) ciCovers(x, delta = 0) ciOverlap(x, y) ciWidth(x)
x, y |
CIs, as obtained from e.g. the 'acCi' function. |
delta |
Variant frequency value to check against [default: 0]. |
A logical vector, where each elements corresponds to the respective row of 'x' (and 'y').
For 'ciWidth': A numeric vector with the widths of the confidence intervals.
## Generate sample data counts = data.frame(x1 = 1:5, n1 = 30, x2 = 0:4, n2 = 30) ## Agresti-Caffo ci_ac = with(counts, acCi(x1, n1, x2, n2)) ci_ac2 = with(counts, acCi(x1, n1, x2, n2, 0.99)) ## cover 0 idx_zero = ciCovers(ci_ac) ## cover 1 idx_one = ciCovers(ci_ac, delta = 1) ## overlap idx_same = ciOverlap(ci_ac, ci_ac2) ## width width = ciWidth(ci_ac)