Section 48 Binomial Distribution: R function

Density, distribution function, quantile function and random generation for the binomial distribution with parameters size and prob.

This is conventionally interpreted as the number of ‘successes’ in size trials.

?dbinom


48.1 Density

dbinom(x, size, prob, log = FALSE)

48.2 Distribution function

pbinom(q, size, prob, lower.tail = TRUE, log.p = FALSE)

48.3 Quantile function

qbinom(p, size, prob, lower.tail = TRUE, log.p = FALSE)

48.4 Random Binomial sample

rbinom(n, size, prob)

48.5 Arguments

x, q : vector of quantiles.

p : vector of probabilities.

n : number of observations. If length(n) > 1, the length is taken to be the number required.

size : number of trials (zero or more).

prob : probability of success on each trial.

log, log.p : logical; if TRUE, probabilities p are given as log(p).

lower.tail : logical; if TRUE (default), probabilities are P[X ≤ x], otherwise, P[X > x].