cdfinv: Computation of confidence intervals via CDF inversion

View source: R/cdfinv.R

cdfinvR Documentation

Computation of confidence intervals via CDF inversion

Description

cdfinv() returns one- or two-sided confidence interval estimates.

Usage

cdfinv(
  DISTR,
  PARAM,
  STAT,
  lpb = -10000,
  upb = 10000,
  bound = "two-sided",
  alpha = 0.05,
  tolb = 1e-06,
  tol = 1e-06,
  ...
)

Arguments

DISTR

name of sampling distribution in R

PARAM

name of distribution parameter for which we are computing an interval estimate

STAT

observed value of the chosen statistic

lpb

lower bound of search interval

upb

upper bound of search interval

bound

one of "two-sided", "lower", or "upper"

alpha

the confidence coefficient is 1 - alpha

tolb

search interval bound offset value

tol

convergence tolerance for uniroot function

...

additional arguments for DISTR's cdf function

Value

A list with interval bounds and associated cdf values.

  • DISTR - The distribution name (as given in R)

  • PARAM - The parameter name (as given in R)

  • STAT - The observed statistic value

  • bound - The interval bound(s)

  • q - The cdf quantile(s) associated with the interval bound(s)

Author(s)

Peter E. Freeman, pfreeman@cmu.edu

Examples

cdfinv("norm","mean",3.45,sd=2) ## returns -0.4699279 and 7.3699277
cdfinv("gamma","rate",12.25,lpb=0,bound="upper",shape=10) ## returns 1.282058
cdfinv("nbinom","prob",22,lpb=0,upb=1,bound="lower",size=10) ## returns 0.1803843

cdfinv documentation built on April 16, 2025, 1:09 a.m.