[R] Query : Chi Square goodness of fit test

priti desai priti.desai at kalyptorisk.com
Mon Jul 3 07:26:45 CEST 2006

If we have the data base of frauds given below

 no. of  frauds = variable


pmf  <- dpois(i, lambda, log = FALSE)  # prob. mass function of variable

How to apply chi-square goodness of fit to test, Sample coming from
Poisson distribution.
How to calculate observed frequencies & expected frequencies, after that
how to calculate chi 2 test and interpret the result  

The formula which I have used & answer which I am getting is as follows,

chisq.test(variable, p=pmf, simulate.p.value =FALSE, correct = FALSE)

        Chi-squared test for given probabilities

data:  No_of_Frouds 
X-squared = 1.043111e+15, df = 32, p-value < 2.2e-16

Warning message:
Chi-squared approximation may be incorrect in: chisq.test(No_of_Frouds,
p = pmf, simulate.p.value = FALSE, correct = FALSE) 

But the answer is not correct. 

Please suggest me the correct variable, calculations & formula in R.

 Awaiting your positive reply.

More information about the R-help mailing list