qcc.overdispersion.test: Overdispersion test for binomial and poisson data

Description Usage Arguments Details Value Author(s) References Examples

View source: R/qcc.R

Description

This function allows to test for overdispersed data in the binomial and poisson case.

Usage

1
qcc.overdispersion.test(x, size, type=ifelse(missing(size), "poisson", "binomial"))

Arguments

x

a vector of observed data values

size

for binomial data, a vector of sample sizes

type

a character string specifying the distribution for testing, either "poisson" or "binomial". By default, if size is provided a binomial distributed is assumed, otherwise a poisson distribution.

Details

This very simple test amounts to compute the statistic

D = Observed variance / Theoretical variance \times (no. observations - 1)

and refer this to a Chi-square distribution with (no. observations - 1) degrees of freedom.

Value

The function returns a matrix of results.

Author(s)

Luca Scrucca

References

Wetherill, G.B. and Brown, D.W. (1991) Statistical Process Control, New York, Chapman and Hall, pp. 216–218

Examples

1
2
3
4
5
6
7
8
9
# 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))
qcc.overdispersion.test(x,size)

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)
qcc.overdispersion.test(x)

Example output

Package 'qcc' version 2.7
Type 'citation("qcc")' for citing this R package in publications.
                   
Overdispersion test Obs.Var/Theor.Var Statistic p-value
      binomial data         0.7644566  22.16924 0.81311
                   
Overdispersion test Obs.Var/Theor.Var Statistic  p-value
       poisson data          1.472203  42.69388 0.048579

qcc documentation built on May 2, 2019, 9:15 a.m.