I have a simple question about the Chi-Square test (unfortunately I only had the extreme maths basics when I was in university). I have the following results:
I think I will use the old data as expected frequency and the new data as observed frequency. My result is as follows.
id New old Chisquare
0 (-26, -22] 17858.0 31704.0 10735.340800
1 (-22, -18] 16060.0 18990.0 534.551681
2 (-18, -14] 20023.0 13964.0 1833.465565
3 (-14, -10] 19845.0 5573.0 10264.045553
4 (-10, -6] 12757.0 779.0 11246.569256
5 (-6, -2] 6446.0 0.0 6446.000000
6 (-2, 2] 1391.0 0.0 1391.000000
Total 94380.0 71010.0 42450.972855
how can i calculate the p value? i have 4 lines of freedom! I use the python code for this:
1 - stats.chi2.cdf((total(Chi^2)), 4)
But my result is:
>>> 1 - stats.chi2.cdf(42450.972855, 4)
0.0
So I wanted to ask if this can be correct, although a change in the data can be recognised in the figure.
