Overdispersion test for binomial and poisson data
qccOverdispersionTest.Rd
This function allows to test for overdispersed data in the binomial and poisson case.
Details
This very simple test amounts to compute the test statistic $$D = s^2 / \sigma^2 \times (n - 1)$$ where \(s^2\) is the observed variance, \(\sigma^2\) is the theoretical variance, and \(n\) is the number of observations. The test statistic is the compared to the critical value of a Chi-square distribution with \(n-1\) degrees of freedom.
References
Wetherill, G.B. and Brown, D.W. (1991) Statistical Process Control, New York, Chapman and Hall, pp. 216–218
Examples
# data from Wetherill and Brown (1991) pp. 212--213, 216--218:
x = c(12,11,18,11,10,16,9,11,14,15,11,9,10,13,12,
8,12,13,10,12,13,16,12,18,16,10,16,10,12,14)
size = rep(50, length(x))
qccOverdispersionTest(x, size)
#>
#> Overdispersion test Obs.Var/Theor.Var Statistic p-value
#> binomial data 0.7644566 22.16924 0.81311
x = c(11,8,13,11,13,17,25,23,11,16,9,15,10,16,12,
8,9,15,4,12,12,12,15,17,14,17,12,12,7,16)
qccOverdispersionTest(x)
#>
#> Overdispersion test Obs.Var/Theor.Var Statistic p-value
#> poisson data 1.472203 42.69388 0.048579