5

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.

Michael E2
  • 235,386
  • 17
  • 334
  • 747
Medvedev
  • 153
  • 2
  • 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 03 '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 03 '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 03 '13 at 11:46
  • May be someone else know hot to implement Pearson Chi Squire test (without function PearsonChiSquareTest)? – Medvedev Oct 03 '13 at 13:33

1 Answers1

6

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.

Andy Ross
  • 19,320
  • 2
  • 61
  • 93