Skip to content

Moods Test

  • Tests whether two categorical variables are associated by comparing observed and expected counts.
  • Uses a contingency table and a chi-squared statistic computed from observed and expected frequencies.
  • Reject the null hypothesis when the chi-squared statistic exceeds a critical value based on the degrees of freedom.

Mood’s test, also known as the chi-squared test for independence, is a statistical test used to determine if there is a significant association between two categorical variables. It is commonly used in research to examine the relationship between a dependent variable and one or more independent variables.

  1. Collect sample data for the two categorical variables and tabulate them in a contingency table showing frequencies for each combination of categories.
  2. Under the null hypothesis of no association, calculate the expected frequency for each cell of the contingency table (the example states that expected frequencies are proportional to the overall sample distribution).
  3. Compute the chi-squared statistic by summing, over all cells, the squared difference between observed (O) and expected (E) frequencies divided by the expected frequency:
χ2=(OE)2E\chi^2 = \sum \frac{(O - E)^2}{E}
  1. Compare the calculated chi-squared statistic to a critical value from the chi-squared distribution table. The source states the number of degrees of freedom is equal to the number of categories of the dependent variable minus one. If the statistic is greater than the critical value, reject the null hypothesis and conclude there is a significant relationship.

Example: relationship between gender and voting behavior

Null hypothesis: there is no relationship between gender and voting behavior. Alternative hypothesis: there is a significant relationship between gender and voting behavior.

Observed contingency table:

Voting behaviorMaleFemale
Republican1525
Democrat1035
Independent1510

Expected contingency table (if no relationship):

Voting behaviorMaleFemale
Republican2030
Democrat1545
Independent515

Chi-squared calculation given in the example:

χ2=(1520)220+(1015)215+(155)25+(2530)230+(3545)245+(1015)215=9.33\chi^2 = \frac{(15-20)^2}{20} + \frac{(10-15)^2}{15} + \frac{(15-5)^2}{5} + \frac{(25-30)^2}{30} + \frac{(35-45)^2}{45} + \frac{(10-15)^2}{15} = 9.33

Comparison to critical value (example): with a sample size of 100 and the number of categories of the dependent variable equal to 3, the example gives a critical value of 7.815. Since 9.33 > 7.815, the null hypothesis is rejected and the example concludes there is a significant relationship between gender and voting behavior.

  • Examining the relationship between a dependent categorical variable and one or more independent categorical variables (as explicitly described in the source).
  • The source states degrees of freedom equal the number of categories of the dependent variable minus one.
  • The decision to reject the null hypothesis depends on comparing the computed chi-squared statistic to a chi-squared distribution critical value corresponding to the stated degrees of freedom (as demonstrated in the example).
  • chi-squared test for independence