Hi,
Would you please help me understand to evaluate the outcome of Chi-Square tests? I want to test whether the data (which are created from a Poisson distribution) do really follow Poisson distribution by chi2gof function.
I am using this pdf http://ocw.mit.edu/courses/mathematics/18-443-statistics-for-applications-fall-2006/lecture-notes/lecture11.pdf as a source to understand the concept and followed the instructions there.
I used the following code to generate 1000 simulations of Poisson samples each having 1000 values with an expected value of 10.
for sim=1:1000 X = poissrnd(10, [1000 1]); [H(sim) P(sim) STATS] = chi2gof(X,'cdf',@(z)poisscdf(z,10));end
I have two questions regarding this issue:
1. When I ran the code like this, there are more rejected hypothesis (i.e. sum(H)) than if I had used
@(z)poisscdf(z,mean(X))
I would expect the first one would have less number of rejected hypothesis since I am using the same expected value for both generating the poisson values and testing them.
2. Can you please help me understand the meaning of 'z' which is used in the function handle?
Kind Regards, Berk
Best Answer