Chi-square test: goodness-of-fit vs independence, the data it needs, and its assumptions

Quick Overview

Describe the chi-square test, when to apply it as a goodness-of-fit test or as a test of independence in a contingency table, and what data it needs. The question tests your grasp of expected counts, degrees of freedom, the test's assumptions and what to use when they fail.

Chi-square test: goodness-of-fit vs independence, the data it needs, and its assumptions

Role: Data Scientist

Category: Statistics & Math

Difficulty: medium

Interview Round: Other

Describe the Chi-square test. When would you use it for goodness-of-fit or testing independence in a contingency table, what data does it work with, and what are its main assumptions? ```hint Start from the null Write down what the null hypothesis predicts for each count, then think about how you would measure the distance between those predictions and what you observed. ``` ### What a Strong Answer Covers - What the test compares, the statistic it uses and its degrees of freedom - The two uses, goodness-of-fit for one variable and independence in a contingency table, including how expected counts are formed - The kind of data the test accepts and the kinds it does not - The main assumptions and what to do when they fail ### Follow-up Questions - Why does the chi-square approximation break down when expected counts are small? - How would you test for a change in a yes/no answer measured on the same people before and after an intervention? - A test of independence on millions of rows returns a p-value below 0.001. What else would you report? - How would you test whether daily signup counts follow a Poisson distribution, and how many degrees of freedom would the test have?

Overview: Describe the chi-square test, when to apply it as a goodness-of-fit test or as a test of independence in a contingency table, and what data it needs. The question tests your grasp of expected counts, degrees of freedom, the test's assumptions and what to use when they fail.

General logo
General
Nov 25, 2026
mediumData ScientistOtherStatistics & Math
0
0

Describe the Chi-square test. When would you use it for goodness-of-fit or testing independence in a contingency table, what data does it work with, and what are its main assumptions?

What a Strong Answer Covers Guidance

  • What the test compares, the statistic it uses and its degrees of freedom
  • The two uses, goodness-of-fit for one variable and independence in a contingency table, including how expected counts are formed
  • The kind of data the test accepts and the kinds it does not
  • The main assumptions and what to do when they fail

Follow-up Questions Guidance

  • Why does the chi-square approximation break down when expected counts are small?
  • How would you test for a change in a yes/no answer measured on the same people before and after an intervention?
  • A test of independence on millions of rows returns a p-value below 0.001. What else would you report?
  • How would you test whether daily signup counts follow a Poisson distribution, and how many degrees of freedom would the test have?