betaTable | R Documentation |
This function computes the cumulative probabilities, the density (probability mass
function values), the percentiles, and the corresponding z-scores based on the specified
parameters of a beta-binomial distribution. The beta-binomial distribution is used to model
the number of successes in a fixed number of trials with success probability varying from
trial to trial, described by beta distribution parameters \alpha
(alpha)
and \beta
(beta).
betaTable(a, b, n, m = NULL)
a |
The |
b |
The |
n |
The number of trials in the beta-binomial distribution. |
m |
An optional stop criterion in table generation. Positive integer lower than n. |
The function utilizes the gamma function to calculate factorial terms needed for the probability mass function (PMF)
and cumulative distribution function (CDF) calculations of the beta-binomial distribution. It iterates over the range
of possible successes (0 to n) to compute the PMF values (Px
), cumulative probabilities (Pcum
), and
mid-percentiles. These percentiles are then used to calculate the corresponding z-scores, which indicate how many
standard deviations an element is from the mean.
A data frame with columns:
The number of successes (0 to n).
The density (probability mass function value) for each number of successes.
The cumulative probability up to each number of successes.
The percentile corresponding to each number of successes.
The z-score corresponding to each percentile.
betaTable(2, 2, 45, 20)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.