N
The Daily Insight

What is an example of a Chi-Square test?

Author

Rachel Ross

Updated on February 26, 2026

What is an example of a Chi-Square test?

Types of Chi-square tests

Chi-Square Goodness of Fit Test
ExampleDecide if bags of candy have the same number of pieces of each flavor or not
Hypotheses in exampleHo: proportion of flavors of candy are the same Ha: proportions of flavors are not the same
Theoretical distribution used in testChi-Square

How do you calculate chi squared?

The chi-square formula is: χ2 = ∑(Oi – Ei)2/Ei, where Oi = observed value (actual value) and Ei = expected value.

Where do we apply Chi-Square test with example?

The data used in calculating a chi-square statistic must be random, raw, mutually exclusive, drawn from independent variables, and drawn from a large enough sample. For example, the results of tossing a fair coin meet these criteria. Chi-square tests are often used in hypothesis testing.

How do Chi-Square tests work?

The chi-square test of independence works by comparing the categorically coded data that you have collected (known as the observed frequencies) with the frequencies that you would expect to get in each cell of a table by chance alone (known as the expected frequencies).

How do you calculate Chi-Square manually?

Let us look at the step-by-step approach to calculate the chi-square value:

  1. Step 1: Subtract each expected frequency from the related observed frequency.
  2. Step 2: Square each value obtained in step 1, i.e. (O-E)2.
  3. Step 3: Divide all the values obtained in step 2 by the related expected frequencies i.e. (O-E)2/E.

How does a chi-square test work?

Why do we use chi square test?

A chi-square test is a statistical test used to compare observed results with expected results. The purpose of this test is to determine if a difference between observed data and expected data is due to chance, or if it is due to a relationship between the variables you are studying.

How do you do a one sample t test?

To run the One Sample t Test, click Analyze > Compare Means > One-Sample T Test. Move the variable Height to the Test Variable(s) area. In the Test Value field, enter 66.5. Click OK to run the One Sample t Test.

Why chi-square test is done?

What are the assumptions of a chi-square test?

The assumptions of the Chi-square include: The data in the cells should be frequencies, or counts of cases rather than percentages or some other transformation of the data. The levels (or categories) of the variables are mutually exclusive.