Learn R Programming

ISCAM (version 1.0.0)

iscambinomtest: Exact Binomial Test

Description

binomtest calculates performs an exact binomial test and graphs the binomial distribution and/or binomial confidence interval.

Usage

iscambinomtest(
  observed,
  n,
  hypothesized = NULL,
  alternative,
  conf.level = NULL,
  verbose = TRUE
)

Value

a list of the p-value along with lower and upper bound for the calculated confidence interval.

Arguments

observed

The observed number of successes or sample proportion (assumed to be proportion if value less than one.)

n

number of trials.

hypothesized

hypothesized probability of success.

alternative

"less", "greater", or "two.sided"

conf.level

Confidence level for a two-sided confidence interval.

verbose

Logical, defaults to TRUE. Set to FALSE to suppress messages

Examples

Run this code

iscambinomtest(
  observed = 17,
  n = 25,
  hypothesized = 0.5,
  alternative = "greater"
)

iscambinomtest(
  observed = 12,
  n = 80,
  hypothesized = 0.10,
  alternative = "two.sided",
  conf.level = 0.95
)

iscambinomtest(
  observed = 0.14,
  n = 100,
  hypothesized = 0.20,
  alternative = "less"
)

iscambinomtest(observed = 17, n = 25, conf.level = 0.95)

iscambinomtest(observed = 12, n = 80, conf.level = c(0.90, 0.95, 0.99))

Run the code above in your browser using DataLab