Description Usage Arguments Details Value Author(s) References See Also Examples
Compute z-score equivalents of negative binomial random deviates.
1 | zscoreNBinom(q, size, mu, method = "midp")
|
q |
numeric vector or matrix of non-negative quantiles. |
size |
numeric vector of non-negative size parameters. |
mu |
numeric vector of means. |
method |
method for converting from discrete to continuous distribution.
Possible values are |
The mid-p method (method=="midp"
) applies a continuity correction by splitting the probability mass of each integer in two.
It computes the mid-p tail probability of q
, then converts to the standard normal deviate with the same cumulative probability distribution value.
Care is taken to do the computations accurately in both tails of the distributions.
The randomized method (method=="random"
) computes randomized quantile residuals (Dunn and Smyth, 1996).
In this method, the tail probabilities are randomized over the possible values covered by the discrete integer counts.
If q
follows a negative binomial distribution with the size and mean correctly specified, then the z-values generated by the randomized method are exactly standard normal.
Non-integer values of q
are allowed.
The mid-p method handles non-integer values by interpolation while the randomized method rounds q
to integers.
Numeric vector or matrix giving equivalent quantiles from the standard normal distribution.
Gordon Smyth
Berry, G., & Armitage, P. (1995). Mid-P confidence intervals: a brief review. The Statistician, 417-423.
Dunn, K. P., and Smyth, G. K. (1996). Randomized quantile residuals. Journal of Computational and Graphical Statistics 5, 1-10. http://www.statsci.org/smyth/pubs/residual.html
pnbinom
, qnorm
in the stats package.
1 | zscoreNBinom(c(0,10,100), mu=10, size=10)
|
Loading required package: limma
[1] -3.2971933 0.1106404 9.3247707
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.