Content
Testing whether observations fit predictions, and whether events are independent, using a χ² distribution.
No exercises available for this concept.
A χ² goodness of fit test compares measured data to expected frequencies, and returns a p-value that captures the likelihood of equal or greater deviation from the expected frequencies. On a calculator:
Enter in L1 the observed frequencies
Enter in L2 the expected frequencies
Find the χ2 GOF-Test on your calculator, with
Observed: L1
Expected: L2
df: (n−1), where n is the number of items in either list
The calculator returns the p-value, which we interpret as usual for a hypothesis test. It also returns the value of χ2, which we can compare to a critical value if it is given.
When the total number of observations is fixed, and we have n different categories, we only have n−1 degrees of freedom since we can find one entry by subtracting the sum of the other entries from the total.
The critical value for a χ² test is a threshold we are given, against which we compare the value of χ² for our data. If our χ² is larger than the critical value, we reject H0.
A χ2 test can also be used to test whether categorical variables are related, for example, does favorite movie depend on gender? It works by comparing how far off the observed data is from what we would expect if the variables were not related (H0).
On a calculator:
Enter the observed frequencies in a matrix (table)
Enter the expected frequencies in a separate matrix or leave them blank if they are not given.
Navigate to χ2-Test on your calculator, and enter the observed and expected matrices (select an empty matrix and your calculator will find the expected values itself) you just filled.
The calculator returns the χ2 value and the p value.