ci-utils: CI Utils

Description Usage Arguments Value Examples

Description

Utility functions to find confidence intervals that (a) overlap a certain value ('ciOutside', 'ciCovers') and (b) different confidence intervals overlap ('ciOverlap').

Usage

1
2
3
4
5
6
7
  ciOutside(x, delta = 0)

  ciCovers(x, delta = 0)

  ciOverlap(x, y)

  ciWidth(x)

Arguments

x, y

CIs, as obtained from e.g. the 'acCi' function.

delta

Variant frequency value to check against [default: 0].

Value

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.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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)

julian-gehring/Rariant documentation built on May 20, 2019, 4:20 a.m.