# PearsonChiSquareTest: set degrees of freedom

How to set degrees of freedom for PearsonChiSquareTest? I have this:

PearsonChiSquareTest[ex,  NormalDistribution[0, Sigma], {"PValue", "DegreesOfFreedom",   "ShortTestConclusion"}, SignificanceLevel -> 0.05]


Return:

{2.95529*10^-11, 12, "Reject"}


I need to set degrees of freedom to 4-5.

-
You don't need to set the df. It's determined from the data. Since the code returns 12, I guess your idea of the number of df is wrong. –  Sjoerd C. de Vries Oct 3 '13 at 11:09
Yes, i think it's ok. But my teacher told me to set DoF to 4 or 5. To confirm the hypothesis. –  Medvedev Oct 3 '13 at 11:19
As I understand it, this tests a histogram of the observed data with an expected one based on the distribution. The degrees of freedom depends on the number bins used and the number of parameters of the distribution that have to be estimate (e.g. Sigma). PearsonChiSquareTest seems to do the binning automatically. You may have to construct a frequency histogram and then do a chi square test. Seems odd one cannot override the binning with an option. Perhaps someone else will know a way. –  Michael E2 Oct 3 '13 at 11:46
May be someone else know hot to implement Pearson Chi Squire test (without function PearsonChiSquareTest)? –  Medvedev Oct 3 '13 at 13:33
I can say with certainty that, as of version 9, it is not possible to set the degrees of freedom for PearsonChiSquareTest. I recommend seeing my answer here for an implementation of your own test that allows you to bin your own data.