[R] Query : Chi Square goodness of fit test

From: priti desai <priti.desai_at_kalyptorisk.com>
Date: Mon 03 Jul 2006 - 15:26:45 EST


If we have the data base of frauds given below

 no. of frauds = variable

variable
<-c(4,1,6,9,9,10,2,4,8,2,3,0,1,2,3,1,3,4,5,4,4,4,9,5,4,3,11,8,12,3,10,0, 7)

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.  

  Regards,
  Priti.



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jul 03 15:28:55 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Mon 03 Jul 2006 - 16:14:37 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.