pBetaBinom: Cumulative Probability Function under the Beta-Binomial...

View source: R/betafunctions.R

pBetaBinomR Documentation

Cumulative Probability Function under the Beta-Binomial Probability Distribution.

Description

Function for calculating the proportion of observations up to a specifiable quantile under the Beta-Binomial Probability Distribution.

Usage

pBetaBinom(q, N, l, u, alpha, beta, lower.tail = TRUE)

Arguments

q

The quantile or a vector of quantiles for which the proportion is to be calculated.

N

The total number of trials.

l

The first (lower) location parameter.

u

The second (upper) location parameter.

alpha

The first shape parameter.

beta

The second shape parameter.

lower.tail

Whether the proportion to be calculated is to be under the lower or upper tail. Default is TRUE (lower tail).

Value

A vector of proportions of observations falling under specified quantiles under the four-parameter Beta distribution.

Examples

# Assume some variable follows a Beta-Binomial distribution with number of
# trials = 50, and probabilities of successful trials are drawn from a four-
# parameter Beta distribution with location parameters l = 0.25 and u =
# 0.75, and shape parameters alpha = 5 and beta = 3. To compute the
# cumulative probability at a specific point of the distribution (e.g., 25):
pBetaBinom(q = 25, N = 50, l = .25, u = .75, alpha = 5, beta = 3)

hthaa/betafunctions documentation built on March 10, 2024, 7:20 p.m.