Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

poiCI

Confidence interval for Poisson counts.


Description

Computes a confidence interval for the Poisson counts.

Usage

poiCI(
  x,
  conf.level = 0.95,
  type = c("exact", "daly", "byar", "asymptotic"),
  verbose = FALSE
)

Arguments

x

A single number or vector that represents the number of observed successes.

conf.level

A number that indicates the level of confidence to use for constructing confidence intervals (default is 0.95).

type

A string that identifies the type of method to use for the calculations. See details.

verbose

A logical that indicates whether x should be included in the returned matrix (=TRUE) or not (=FALSE; DEFAULT).

Details

Computes a CI for the Poisson counts using the exact, gamma distribution (daly‘), Byar’s (byar), or normal approximation (asymptotic) methods.

The pois.daly function gives essentially identical answers to the pois.exact function except when x=0. When x=0, for the upper confidence limit pois.exact returns 3.689 and pois.daly returns 2.996.

Value

A #x2 matrix that contains the lower and upper confidence interval bounds as columns and, if verbose=TRUE x.

Author(s)

Derek H. Ogle, derek@derekogle.com, though this is largely based on pois.exact, pois.daly, pois.byar, and pois.approx from the old epitools package.

Examples

## Demonstrates using all types at once
poiCI(12)

## Selecting types
poiCI(12,type="daly")
poiCI(12,type="byar")
poiCI(12,type="asymptotic")
poiCI(12,type="asymptotic",verbose=TRUE)
poiCI(12,type=c("exact","daly"))
poiCI(12,type=c("exact","daly"),verbose=TRUE)

## Demonstrates use with multiple inputs
poiCI(c(7,10),type="exact")
poiCI(c(7,10),type="exact",verbose=TRUE)

FSA

Simple Fisheries Stock Assessment Methods

v0.8.32
GPL (>= 2)
Authors
Derek Ogle [aut, cre] (<https://orcid.org/0000-0002-0370-9299>), Powell Wheeler [aut], Alexis Dinno [aut] (Provided base functionality of dunnTest())
Initial release
2021-1-15

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.