binconr: 'bincon' formatter

View source: R/utils2.R

binconrR Documentation

bincon formatter

Description

Binomial confidence interval (bincon) formatter.

Note that this function will also calculate confidence intervals for two-stage designs by method="two-stage". If both r and n are length 2, a two-stage design is assumed. If r and n are not both length 1 or 2, the function will fail. For vector inputs, see bincon.

Usage

binconr(
  r,
  n,
  conf = 0.95,
  digits = 0L,
  est = TRUE,
  frac = FALSE,
  show_conf = TRUE,
  pct.sign = TRUE,
  method = "exact",
  percent = TRUE
)

Arguments

r

number of responses (successes)

n

number of observations (trials)

conf

level of confidence

digits

number of digits

est

logical; if TRUE, includes the point estimate

frac

logical; if TRUE, includes the fraction r/n

show_conf

logical; if TRUE includes the confidence level

pct.sign

logical; if TRUE, percent sign is shown; otherwise, percents are shown without sign (this does not affect the confidence text)

method

method to use (default is exact); see bincon

percent

logical; if TRUE (default), estimates and intervals are returned as percentages

See Also

bincon; binconf

Examples

binconr(5, 10)
binconr(5, 10, percent = FALSE)

binconr(5, 10, 0.90, est = FALSE)
binconr(45, 53, digits = 1, conf = 0.975)
binconr(45, 53, show_conf = FALSE, frac = TRUE)

## length 2 vectors assume two-stage confidence intervals
binconr(c(15, 45), c(20, 33), show_conf = FALSE, frac = TRUE)
## compare
rawr:::twocon(20, 33, 15, 45)


raredd/rawr documentation built on March 4, 2024, 1:36 a.m.