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

DoubleBinom

Double Binomial Distribution


Description

These functions provide information about the double binomial distribution with parameters m and s: density, cumulative distribution, quantiles, and random generation.

The double binomial distribution with total = n and prob = m has density

p(y) = c(n,m,s) Choose(n,y) n^(n s) (m/y)^(y s) ((1-m)/(n-y))^(s(n-y)) y^y (n-y)^(n-y)

for y = 0, …, n, where c(.) is a normalizing constant.

Usage

ddoublebinom(y, size, m, s, log=FALSE)
pdoublebinom(q, size, m, s)
qdoublebinom(p, size, m, s)
rdoublebinom(n, size, m, s)

Arguments

y

vector of frequencies

q

vector of quantiles

p

vector of probabilities

n

number of values to generate

size

vector of totals

m

vector of probabilities of success

s

vector of overdispersion parameters

log

if TRUE, log probabilities are supplied.

Author(s)

J.K. Lindsey

See Also

dbinom for the binomial, dmultbinom for the multiplicative binomial, and dbetabinom for the beta binomial distribution.

Examples

# compute P(45 < y < 55) for y double binomial(100,0.5,1.1)
sum(ddoublebinom(46:54, 100, 0.5, 1.1))
pdoublebinom(54, 100, 0.5, 1.1)-pdoublebinom(45, 100, 0.5, 1.1)
pdoublebinom(2,10,0.5,1.1)
qdoublebinom(0.05,10,0.5,1.1)
rdoublebinom(10,10,0.5,1.1)

rmutil

Utilities for Nonlinear Regression and Repeated Measurements Models

v1.1.5
GPL-2
Authors
Bruce Swihart [cre, aut], Jim Lindsey [aut] (Jim created this package, Bruce is maintaining the CRAN version)
Initial release

We don't support your browser anymore

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