chi2gof function combines bins even with EMin set to zero
1 view (last 30 days)
Show older comments
While running a chi-square test for certain data (with respect to the t-distribution) I set a certain number of bins as a standrd (5) and wanted to keep this despite low count in certain bins, which I did by setting EMin = 0 (as specified by the documentation). However even while doing this the function combines neighbouring bins from 5 to 2 (I assume due to the poor fit of the distribution to the data distibution).
This is what I wrote, given t a certain data set:
nparams = 0;
nbins = 5;
tdist = @(x) tpdf(x,n-2);
[H,p,stats] = chi2gof(t,'CDF',tdist,'nbins',nbins,'nparams',nparams,'emin',0);
disp(stats)
disp([H p])
This returns:
chi2stat: 103.7404
df: 1
edges: [-4.0438 0.9718 2.2257]
O: [47 11]
E: [13.8933 44.1067]
where data is divided in 2 bins, despite the fact that I set nbins = 5 and emin = 0. Why does this happen? Can I change it to do it the way I want to? (I know this won't change the result, i.e. the null hypothesis is rejected at the given confidence level, but I still would want it to give the result I expect)
0 Comments
Answers (1)
Aditya Patil
on 29 Mar 2021
I have brought this issue to the notice of concerned developers. It might be fixed in any of the upcoming releases.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!