Activity 33

MATH 216: Statistical Thinking

Chi-Square Goodness-of-Fit Tests

Time Allocation: 15 minutes total (5 min reading, 10 min individual work)

Part 1: Chi-Square Calculations (12 minutes)

Perform chi-square goodness-of-fit test calculations for the following 4 scenarios:

Example 1: Fair Die Test

Context: Testing if a six-sided die is fair

  • Observed counts: 1:12, 2:7, 3:14, 4:15, 5:4, 6:8 (total = 60 rolls)
  • Expected under \(H_0\): Each side = 10 (equal probability)

Calculate:

  • \(\chi^2\) =
  • \(df\) =
  • Decision at \(\alpha = 0.05\):

Example 2: Gender Representation in STEM

Context: Testing if university STEM program has equal gender representation

  • Observed: Female = 200, Male = 300 (total = 500 students)
  • Expected under \(H_0\): Female = 250, Male = 250 (equal representation)

Calculate:

  • \(\chi^2\) =
  • \(df\) =
  • Decision at \(\alpha = 0.05\):

Example 3: Genetic Inheritance Test

Context: Testing if genetic traits follow Mendelian 3:1 ratio

  • Observed: Dominant = 75, Recessive = 25 (total = 100 offspring)
  • Expected under \(H_0\): Dominant = 75, Recessive = 25 (3:1 ratio)

Calculate:

  • \(\chi^2\) =
  • \(df\) =
  • Decision at \(\alpha = 0.05\):

Example 4: Survey Response Distribution

Context: Testing if survey responses follow uniform distribution

  • Observed: A=12, B=15, C=18, D=10 (total = 55 responses)
  • Expected under \(H_0\): Each category = 13.75 (equal probability)

Calculate:

  • \(\chi^2\) =
  • \(df\) =
  • Decision at \(\alpha = 0.05\):

Show your work for one calculation:

# R code for chi-square goodness-of-fit calculations (for reference)

# Example 1: Fair Die Test
observed_die <- c(12, 7, 14, 15, 4, 8)
expected_probs_die <- rep(1/6, 6)
die_test <- chisq.test(x = observed_die, p = expected_probs_die)
die_test

    Chi-squared test for given probabilities

data:  observed_die
X-squared = 9.4, df = 5, p-value = 0.09413
# Example 2: Gender Representation
observed_gender <- c(200, 300)
expected_probs_gender <- c(0.5, 0.5)
gender_test <- chisq.test(x = observed_gender, p = expected_probs_gender)
gender_test

    Chi-squared test for given probabilities

data:  observed_gender
X-squared = 20, df = 1, p-value = 7.744e-06
# Example 3: Genetic Inheritance
observed_genetic <- c(75, 25)
expected_probs_genetic <- c(0.75, 0.25)
genetic_test <- chisq.test(x = observed_genetic, p = expected_probs_genetic)
genetic_test

    Chi-squared test for given probabilities

data:  observed_genetic
X-squared = 0, df = 1, p-value = 1
# Example 4: Survey Response Distribution
observed_survey <- c(12, 15, 18, 10)
expected_probs_survey <- rep(1/4, 4)
survey_test <- chisq.test(x = observed_survey, p = expected_probs_survey)
survey_test

    Chi-squared test for given probabilities

data:  observed_survey
X-squared = 2.6727, df = 3, p-value = 0.4449

Part 2: Decision Making and Interpretation (3 minutes)

Make decisions and interpret results:

  1. For the fair die test (Example 1), what does your conclusion tell us about the die’s fairness?
  1. For the gender representation study (Example 2), what practical implications does your finding have for the STEM program?

Critical Thinking: Why is it important to check the expected counts assumption before interpreting chi-square test results?