I try to make a histogram and then fit some distribution to it by means of chi2. The Knuth rule (I have some bimodal cases so I'm not using Freedman-Diaconis or Scott) gives me the following histogram (there are 914 data points):

enter image description here

The problem is that there are two bins with less than 5 counts, so it's not really justified to believe a result of a chi2 fitting. How can I cope with this problem? Should I just merge the underpopulated bins with their neighbours (variable bin-widths)? I tried manually playing with the number of (equal-width) bins checking if there's a binning with all the counts $\geq 5$ but with no luck. What about just excluding the data from the underpopulated bins (is it justified to call them outliers?)?

  • 1
    $\begingroup$ It seems from your question that you have the actual values and can group them into the histogram as you wish. If so, why do you need to group them into the histogram to fit a distribution? $\endgroup$ – EdM May 18 '15 at 22:26
  • 1
    $\begingroup$ This link gives lots of tips for chi-squared goodness of fit tests. It talks about small cell frequencies and also has a discussion about how to deal continuous data. $\endgroup$ – Eric Farng May 18 '15 at 22:44
  • 5
    $\begingroup$ If you have the underlying data points, forcing them into bins throws away all the information about the distribution within the bins. There is no need to proceed in that way. An answer to this question on fitting distributions to data includes an extensive list of tools available in R for this task without resorting to binning. The discussion on that page contains much useful additional information. $\endgroup$ – EdM May 19 '15 at 12:14
  • $\begingroup$ Quantile-quantile plots are by far the best way to assess fit to specified distributions. Chi-square testing is essentially useless compared with alternatives. Apart from arbitrary loss of information, It is often insensitive precisely where sensitivity is needed, usually in the tails. Its continued recommendation in some places is hard to fathom. $\endgroup$ – Nick Cox Dec 13 '19 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.