MATLAB: Very small p value

chi2gofp-value

I am using chi2gof to test whether my data is distributed normally. Graphically, it looks very normal, and I have fitted a normal curve to it that 'looks' good.
[h,p]=chi2gof(histdata)
h =
1
p =
0
Chi2gof reports the p value as zero – any advice on calculating the actual p value? I need to know if it is p < 0.0001 or p < 0.0000001 or whatever.

Best Answer

Hi Micah, A couple things to try:
Set the format to long.
format long
[h,p] = chi2gof(histdata)
It may be that the p-value is really essentially zero, I mean if the p-value is 10^{-6}, are you really going to report that? You may as well just say p<0.001
Another thing is return the stats from chi2gof() and check that.
[h,p,st] = chi2gof(histdata);
1-chi2cdf(st.chi2stat,st.df)
Does that also just say 0?