8.8
The goodness-of-fit test is a type of hypothesis test which determines whether the data "fits" a particular distribution. For example, one may suspect…
The goodness-of-fit test establishes whether an observed frequency distribution mirrors a claimed distribution.
Consider the dataset of people visiting the gym on weekdays. One can perform a goodness-of-fit test to determine whether the observed client attendance agrees with the expected frequency of client attendance.
To perform a goodness-of-fit test, the dataset values must be randomly selected and have a frequency value for each category, with the expected frequency of each category being at least 5.
The chi-square test statistic for the goodness-of-fit test can be computed using the shown formula. Here, O and E represent the observed and expected attendances, k is the number of weekdays, and n is the number of sample values or attendance counts recorded. The number of degrees of freedom is k minus one.
Goodness-of-fit hypothesis tests are always right-tailed, implying that the critical region and critical values are located at the extreme right of the distribution curve.
The critical values and P-values help determine if there is a good fit between the observed and expected values.
View the full transcript and gain access to JoVE Core videos
Q1: What is the purpose of a goodness-of-fit test?
A goodness-of-fit test determines whether an observed frequency distribution matches a claimed or theoretical distribution. For example, you can test whether gym attendance data aligns with expected attendance patterns. The test uses observed values from your data and expected values from theory to assess how well they fit together.
Q2: What are the requirements for performing a goodness-of-fit test?
Data must be randomly selected with a frequency value for each category. Critically, the expected frequency for each category must be at least 5. These conditions ensure the chi-square test statistic is valid and reliable for determining whether observed and expected values show a good fit.
Q3: How is the chi-square test statistic calculated for goodness-of-fit?
The chi-square statistic is computed by summing the squared differences between observed and expected values, divided by expected values. The formula uses O for observed attendance, E for expected attendance, and k for the number of categories. This calculation measures how far observed data deviates from theoretical expectations.
Q4: What are degrees of freedom in a goodness-of-fit test?
Degrees of freedom equal k minus one, where k is the number of categories or data cells. For example, with five weekdays, degrees of freedom would be four. This value is essential for determining critical values and interpreting test results using the chi-square distribution.
Q5: Why are goodness-of-fit tests always right-tailed?
Goodness-of-fit tests are right-tailed because the critical region and critical values are located at the extreme right of the chi-square distribution curve. When observed and expected values diverge significantly, the test statistic becomes large and falls in this right tail, indicating a poor fit between the data and theoretical distribution.
Q6: How do critical values and P-values help interpret goodness-of-fit results?
Critical values and P-values determine whether there is a good fit between observed and expected values. If the test statistic exceeds the critical value or the P-value is below your significance level, you reject the null hypothesis, concluding the data does not fit the claimed distribution.
Q7: What is the difference between observed and expected values in this test?
Observed values are the actual data collected from your sample, such as recorded gym attendance counts. Expected values are the frequencies you would anticipate if the null hypothesis were true, based on theory or a claimed distribution. Comparing these two sets determines whether your data fits the theoretical model.