You are on page 1of 3

Excel can be used to Calculate a P-Value for a Chi Square Goodness of Fit Test

See next tab to enter data and actually calculate values!

The test is conducted with at least 2 set of values for example:

Observed Expected The expected value for any cell =


1995 2003 Totals 1995 2003 row total for that cell column total for the cell
Present 8 16 24 12 12 the grand total of rows and cells.
Absent 12 4 16 8 8 For example, for 1995 Present: (24 * 20) / 40 = 12
Totals 20 20 40

2= 8 12 2 + 1 5 12 2 + 1 2 8 2 + 5 8 2
12 12 8 8

2= 1.333333 + 1.333333 + 2 + 2 = 6.666667


Then, compare calculated value to "critical" (or table) value in a chi-square table
In this example. 6.7 is > than a critical value for of 5% of 3.841 and is also > critical value for an of 10% of 2.706
Therefore, reject the null hypothesis that "nothing is going on" and conclude that there was a change from 1995 to 2003

Excel also has a feature to calculate the probability of a significant Chi-Square value
With Excel "ChiTest" 0.009823 = the probability (or alpha) of the Chi-Square value
For alpha of 5% if the ChiTest value is < 0.05 then reject null hypothesis that "nothing is going on"
For alpha of 10% if the ChiTest value is < 0.1 then reject null hypothesis that "nothing is going on"
Enter Data below to Calculate a P-Value for a Chi Square Goodness of Fit Test

CHANGE the 1's to your values


For example: Observed Expected
Year 1 Year 2 Totals Year 1 Year 2
Present 7 73 80 10.5 69.5
Absent 14 66 80 40 69.5
Totals 21 139 160
Values in Blue will be calculat

2= 1.166667 + 372.0238 + 16.9 + 16.9 =


Then compare calculated value to "critical" (or table) value in a chi-square table
Compare 406.9905 to a critical value for of 5% of 3.841 of 10% of 2.706 or look in Chi-Square Cr
Reject the null hypothesis that "nothing is going on" if the Calculated value is > the Critical Value

With Excel "ChiTest": 1.8E-05 = the probability (or alpha) of the Chi-Square value
For alpha of 5%, if the ChiTest value is < 0.05 then reject null hypothesis that "nothing is goi
For alpha of 10%, if the ChiTest value is < 0.1 then reject null hypothesis that "nothing is goi

Calculations a P-Value for a 3 by 2 Chi Square Goodness of Fit Test

CHANGE the 1's to your values


Observed Expected
Year 1 Year 2 Year 3 Totals Year 1 Year 2 Year 2
Present 1 1 1 2 1 1 1
Absent 1 1 1 2 1 1 1
Totals 2 2 2 4
Values in Blue will b

2= 0 + 0 + 0
0 + 0 + 0 = 0
Then compare calculated value to "critical" (or table) value in a chi-square table
Compare 0 to a critical value for of 5% of 5.991 of 10% of 4.605 or look in Chi-Square Cr
Reject the null hypothesis that "nothing is going on" if the Calculated value is > the Critical Value

With Excel "ChiTest": 1 = the probability (or alpha) of the Chi-Square value
For alpha of 5%, if the ChiTest value is < 0.05 then reject null hypothesis that "nothing is goi
For alpha of 10%, if the ChiTest value is < 0.1 then reject null hypothesis that "nothing is goi
s of Fit Test

n Blue will be calculated

406.9905

6 or look in Chi-Square Critical Value Table


> the Critical Value

thesis that "nothing is going on"


thesis that "nothing is going on"

Values in Blue will be calculated

5 or look in Chi-Square Critical Value Table


> the Critical Value

thesis that "nothing is going on"


thesis that "nothing is going on"

You might also like