A simple test of a hypothesis that a given sample 'x' comes from a Poisson distribution with unknown parameter. The test is described in Zvara (2008), chapter 10.5.

poissonTest(x, alpha = 0.05, na.rm = FALSE)

Arguments

x

a vector of samples

alpha

significance level

na.rm

shall NA's be removed first?

Value

a list of 'q' (the test statistics), 'q1, q2' (the critical values), and 'p' (the p-value of the test)

References

Karel Zv\'ara. _Regrese._ Matfyzpress Praha 2008. Chapter 10.5

Examples

poissonTest(rpois(20,3))
#> Warning: The estimate of the rate parameter is less then 5, the test may be inaccurate.
#> #> Chi-square test of Poisson distribution #> #> data: rpois(20, 3) #> X-squared = 11.816, p-value = 0.2133 #>
poissonTest(abs(rnorm(20)))
#> Warning: The estimate of the rate parameter is less then 5, the test may be inaccurate.
#> #> Chi-square test of Poisson distribution #> #> data: abs(rnorm(20)) #> X-squared = 7.3521, p-value = 0.01583 #>