poissonDispersionPValues

fun poissonDispersionPValues(testStatistic: Double, sampleSize: Double): Triple<Double, Double, Double>(source)

Computes the upper, lower, and two-sided p-values for the Poisson variance test statistic T, referred to a chi-squared distribution with n−1 degrees of freedom. The upper p-value (P(chi-squared >= T)) tests for overdispersion, the lower (P(chi-squared <= T)) for underdispersion, and the two-sided is 2*min(upper, lower). Degenerate inputs (NaN/infinite T, or a sample size less than two) yield NaN p-values.

This is the single source of truth for the dispersion p-values shown in the discrete report (both the data-summary and per-fit sections) and carried on the result DTO.

Return

a triple of (upper, lower, two-sided) p-values

Parameters

testStatistic

the Poisson variance test statistic T

sampleSize

the number of observations