1
$\begingroup$

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:

enter image description here

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.

$\endgroup$
1
  • 2
    $\begingroup$ Unfortunately (unless I missed it) I don't see anything in this about Earth Science as posted? There is a Stats SE, though there may be a chance they consider it a basic question answered elsewhere/by other questions, so you may need to research first. Frustrating when you're struggling to find the answer (I well know), but unfortunately how stack exchange is setup as of now. Could also try or expanding your question to more directly relate to Earth Science choices, or try chat. $\endgroup$ Commented Jul 13, 2022 at 19:11

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.