What is the chi-square goodness-of-fit test?
The chi-square goodness-of-fit test is a non-parametric hypothesis test. This test is used to determine whether a variable is likely to follow a specified distribution. For example, let’s say we rolled a die 60 times. Now, if the die is a fair die, then we are expected to get each of the numbers 1, 2, 3, 4, 5, and 6 60/6=10 times. But let’s say we got the numbers 1, 2, 3, 4, 5, and 6 the following number of times: 5, 12, 7, 9, 14, 13. So, we can see a difference between the expected values and the obtained values. But is the difference statistically significant?
In other words, we want to know whether the categorical variable indeed follows a specific distribution, a discrete uniform distribution in our case, or whether the observed difference arises by chance only. To know that, we can perform a chi-square goodness-of-fit test.
Please note that the chi-square goodness-of-fit test should follow certain assumptions. They are:
1. We need to take random samples from the population.
2. We need to perform the chi-square goodness-of-fit test on categorical or nominal data.
3. A minimum of five observations is expected for data categories.
How is the test statistic calculated in the chi-square goodness-of-fit test?
In the chi-square goodness-of-fit test, the test statistic is calculated using the following formula:
n = the number of categories of the categorical variable = 6 in our case
Oi = the number of times the ith number appears on the face of the die.
Ei = the expected number of times the ith number should appear on the face of the die
So, in our case, we got the numbers 1, 2, 3, 4, 5, and 6 the following number of times: 5, 12, 7, 9, 14, 13. And each number …








































0 Comments