Home / AP Statistics 3.14 Setting Up a Chi-Square Test for Homogeneity or Independence Study Notes

AP Statistics 3.14 Setting Up a Chi-Square Test for Homogeneity or Independence Study Notes - New Syllabus

AP Statistics 3.14 Chi-Square Tests Study Notes – New Syllabus

AP Statistics 3.14 Chi-Square Tests Study Notes – As per latest AP Statistics Syllabus.

LEARNING OBJECTIVES

  • 3.14.A Describe chi-square distributions.
  • 3.14.B Identify an appropriate testing method for comparing distributions in two-way tables of categorical data including the populations and variables.
  • 3.14.C Identify the null and alternative hypotheses for a chi-square test for homogeneity or independence.
  • 3.14.D Justify the appropriateness of a chi-square test for independence or homogeneity by verifying conditions.

ESSENTIAL KNOWLEDGE:

  • 3.14.A.1 The chi-square statistic measures the distance between observed and expected counts relative to expected counts.
  • 3.14.A.2 Chi-square distributions have positive values and are skewed right. Within this family of density curves, the skew becomes less pronounced with increasing degrees of freedom.
  • 3.14.B.1 To determine whether the distributions of a categorical variable for two or more populations are different, the appropriate test is the chi-square test for homogeneity.
  • 3.14.B.2 A chi-square test for homogeneity should reference the categorical variable and the populations in context.
  • 3.14.B.3 To determine whether row and column variables in a two-way table of categorical data might be associated in the single population from which the data were sampled, the appropriate test is the chi-square test for independence.
  • 3.14.B.4 A chi-square test for independence should reference the categorical variables and the population in context.
  • 3.14.C.1 The appropriate null hypothesis for a chi-square test for homogeneity is \(H_0\): there is no difference in the distributions of the categorical variable across populations or treatments. The appropriate alternative hypothesis is \(H_a\): there is a difference in the distributions of the categorical variable across populations or treatments.
  • 3.14.C.2 The appropriate null hypothesis for a chi-square test for independence is \(H_0\): there is no association between two categorical variables in a given population or the two categorical variables in a given population are independent of each other. The appropriate alternative hypothesis is \(H_a\): there is an association between two categorical variables in a given population or the two categorical variables in a given population are not independent of each other.
  • 3.14.D.1 A chi-square test for homogeneity or independence requires that three conditions must be met:
    • 3.14.D.1.i The randomization condition—the test of independence states that the data should be collected using a random sample. The test for homogeneity states that the data should be collected using independent random samples or a randomized experiment.
    • 3.14.D.1.ii The 10% condition—when sampling without replacement, check that \(n\le10\%N\), where \(N\) is the size of the population and \(n\) is the sample size. (This condition is unnecessary when the data are from a randomized experiment.)
    • 3.14.D.1.iii The expected counts condition—all expected counts should be greater than 5.

AP Statistics – Concise Summary Notes – All Topics

3.14.A.1 Understanding the Chi-Square Statistic

A chi-square (\(\chi^2\)) statistic measures how closely the observed counts from the data match the expected counts predicted by a statistical model.

  • It measures the overall difference between the observed counts and the expected counts, relative to the expected counts.
  • If the observed counts are very close to the expected counts, the chi-square statistic will be small.
  • If the observed counts differ greatly from the expected counts, the chi-square statistic will be large.

Chi-Square Statistic Formula

\(\chi^2=\sum\dfrac{(O-E)^2}{E}\)

Where:

  • \(O\) = Observed count
  • \(E\) = Expected count
  • \(\sum\) = Add the values for all categories or cells

How the Formula Works

  • Find the difference between each observed and expected count.
  • Square each difference so all values are positive.
  • Divide each squared difference by its corresponding expected count.
  • Add all of the values to obtain the chi-square statistic.

Interpreting the Chi-Square Statistic

Chi-Square StatisticInterpretation
SmallObserved counts are close to the expected counts.
LargeObserved counts differ substantially from the expected counts.

Example 1

A survey predicts that 50 students should prefer online learning.

The observed count is 55.

The contribution to the chi-square statistic is

\(\dfrac{(55-50)^2}{50}=\dfrac{25}{50}=0.50\)

This small contribution indicates that the observed count is close to the expected count.

Example 2

An expected count for a category is 40, but the observed count is 60.

The contribution is

\(\dfrac{(60-40)^2}{40}=\dfrac{400}{40}=10\)

This larger contribution indicates that the observed count differs substantially from the expected count.


3.14.A.2 Shape of the Chi-Square Distribution

The chi-square distribution is the probability distribution used with chi-square test statistics.

 

Unlike the standard Normal distribution, the chi-square distribution:

  • Contains only positive values.
  • Is skewed to the right.
  • Has a different shape depending on the degrees of freedom (df).

As the degrees of freedom increase, the distribution becomes less skewed and more nearly symmetric.

Characteristics of the Chi-Square Distribution

CharacteristicDescription
Possible ValuesOnly positive values (\(\chi^2\ge0\))
ShapeRight-skewed
Degrees of FreedomDifferent values of \(df\) produce different chi-square distributions.
Effect of Increasing \(df\)The distribution becomes less skewed and more spread out.

Example

A chi-square test with

\(df=2\)

has a noticeably right-skewed distribution.

A chi-square test with

\(df=20\)

has a distribution that is still right-skewed but much less so than when \(df=2\).

Important AP Exam Notes

  • The chi-square statistic measures the difference between observed and expected counts.
  • Small values of \(\chi^2\) indicate that the observed counts are close to the expected counts.
  • Large values of \(\chi^2\) indicate greater disagreement between the observed and expected counts.
  • The chi-square distribution contains only nonnegative values.
  • Every chi-square distribution is right-skewed.
  • As the degrees of freedom increase, the distribution becomes less skewed.

Common AP Exam Mistakes

IncorrectCorrect
A chi-square statistic can be negative.A chi-square statistic is always zero or positive.
A larger chi-square statistic means the model fits better.A larger chi-square statistic indicates greater disagreement between observed and expected counts.
The chi-square distribution is symmetric.The chi-square distribution is right-skewed.

 Example

A goodness-of-fit test compares observed counts with expected counts for four categories.

The calculated chi-square statistic is

\(\chi^2=9.84\)

Explain what this statistic measures and describe one characteristic of the chi-square distribution.

▶️ Answer / Explanation

The chi-square statistic measures the overall difference between the observed counts and the expected counts, relative to the expected counts.

A value of \(\chi^2=9.84\) indicates the observed counts differ from the expected counts by this overall amount.

One characteristic of the chi-square distribution is that it contains only nonnegative values and is skewed to the right.

3.14.B.1 Identifying the Appropriate Chi-Square Test

When analyzing categorical data displayed in a two-way table, the appropriate chi-square test depends on the purpose of the study.

There are two commonly used chi-square tests:

  • Chi-Square Test for Homogeneity
  • Chi-Square Test for Independence

Although both tests use the same chi-square statistic and calculations, they answer different statistical questions.

Chi-Square Test for Homogeneity

The chi-square test for homogeneity is used to determine whether the distribution of a categorical variable is the same across two or more populations.

Data are collected from two or more independent populations or treatment groups, and the categorical responses are compared.

When to Use

  • Compare two or more populations.
  • One categorical response variable is measured for each population.
  • Determine whether the distributions are the same or different.

Example 1

A researcher compares the preferred social media platform of students from three different schools.

Question:

Is the distribution of preferred social media platforms the same for students from the three schools?

Appropriate Test:

Chi-Square Test for Homogeneity

Example 2

A company surveys customers from four different stores to compare their preferred payment method.

Appropriate Test:

Chi-Square Test for Homogeneity


3.14.B.2 Identifying the Population Parameter for a Test for Homogeneity

For a chi-square test for homogeneity, the parameter should describe:

  • The categorical response variable.
  • The two or more populations being compared.

The parameter should always be written in context.

Examples of Appropriate Parameter Statements

StudyPopulation Parameter
Favorite social media platform at three schoolsThe distribution of preferred social media platforms for students at each of the three schools.
Preferred payment method at four storesThe distribution of preferred payment methods for customers at each of the four stores.

Homogeneity vs. Independence (Preview)

HomogeneityIndependence
Compares distributions across multiple populations.Examines the relationship between two categorical variables within a single population.

Important AP Exam Notes

  • Use a chi-square test for homogeneity when comparing the distribution of a categorical variable across two or more populations.
  • The populations should be independent.
  • The parameter statement should identify the categorical variable and the populations in context.
  • Do not confuse a test for homogeneity with a test for independence.

Common AP Exam Mistakes

IncorrectCorrect
Using a test for independence when comparing different populations.Use a chi-square test for homogeneity.
Describing only the categorical variable.Reference both the categorical variable and the populations being compared.
Assuming homogeneity tests use one population.Homogeneity compares multiple populations.

 Example

A university surveys students from three different campuses to compare their preferred mode of transportation to class (car, bus, bicycle, or walking).

Identify the appropriate statistical test and describe the population parameter in context.

▶️ Answer / Explanation

Appropriate Test:

A chi-square test for homogeneity because the goal is to compare the distribution of one categorical variable (preferred mode of transportation) across three different populations (the campuses).

Population Parameter:

The distribution of preferred modes of transportation for students at each of the three university campuses.

3.14.B.3 Identifying a Chi-Square Test for Independence

The chi-square test for independence is used to determine whether two categorical variables are associated in a single population.

Unlike a chi-square test for homogeneity, data for a test of independence are collected from one random sample taken from a single population.

Each individual in the sample is classified according to two categorical variables, and the goal is to determine whether the variables are related.

When to Use

  • One random sample is selected from a single population.
  • Each individual is classified according to two categorical variables.
  • Determine whether the two variables are associated (dependent) or independent.

Example 1

A random sample of high school students is selected.

For each student, the researcher records:

  • Grade Level (9th, 10th, 11th, 12th)
  • Preferred Lunch Option (School Lunch or Packed Lunch)

Question:

Is preferred lunch option associated with grade level?

Appropriate Test:

Chi-Square Test for Independence

Example 2

A researcher randomly samples adults from one city and records:

  • Employment Status
  • Home Ownership Status

Question:

Are employment status and home ownership associated?

Appropriate Test:

Chi-Square Test for Independence


3.14.B.4 Identifying the Population Parameter for a Test for Independence

For a chi-square test for independence, the parameter should reference:

  • The two categorical variables.
  • The single population from which the sample was selected.

The parameter should always be written in context.

Examples of Appropriate Parameter Statements

StudyPopulation Parameter
Lunch preference and grade levelThe association between grade level and preferred lunch option for all students at the school.
Employment and home ownershipThe association between employment status and home ownership among all adults in the city.

Homogeneity vs. Independence

Chi-Square Test for HomogeneityChi-Square Test for Independence
Compares distributions across two or more populations.Examines the relationship between two categorical variables in one population.
Uses two or more independent samples (or treatment groups).Uses one random sample from a single population.
Question: Are the distributions the same?Question: Are the two variables associated?

Important AP Exam Notes

  • Use a chi-square test for independence when studying the relationship between two categorical variables.
  • The data come from one random sample taken from a single population.
  • The parameter statement should reference the two categorical variables and the population.
  • Do not confuse a test for independence with a test for homogeneity.

Common AP Exam Mistakes

IncorrectCorrect
Using a test for homogeneity with one population.Use a chi-square test for independence when there is one population and two categorical variables.
Referring to multiple populations.A test for independence involves only one population.
Describing only one categorical variable.Reference both categorical variables in the parameter statement.

 Example

A researcher randomly selects 500 college students from one university.

Each student is classified by:

  • Class Year (Freshman, Sophomore, Junior, Senior)
  • Housing Type (On-campus or Off-campus)

Identify the appropriate statistical test and describe the population parameter in context.

▶️ Answer / Explanation

Appropriate Test:

A chi-square test for independence because one random sample was taken from a single population, and the goal is to determine whether two categorical variables are associated.

Population Parameter:

The association between class year and housing type for all students at the university.

3.14.C.1 Writing Hypotheses for a Chi-Square Test for Homogeneity

A chi-square test for homogeneity is used to determine whether the distribution of a categorical variable is the same across two or more populations or treatment groups.

The hypotheses compare the distributions of the categorical variable among the different populations.

Null Hypothesis (\(H_0\))

The distribution of the categorical variable is the same across all populations or treatment groups.

\(H_0\): There is no difference in the distributions of the categorical variable across the populations (or treatments).

Alternative Hypothesis (\(H_a\))

At least one population has a different distribution of the categorical variable.

\(H_a\): There is a difference in the distributions of the categorical variable across the populations (or treatments).

Example

A researcher compares the preferred streaming service of students from three different schools.

Hypotheses:

\(H_0\): The distribution of preferred streaming services is the same for students at all three schools.

\(H_a\): The distribution of preferred streaming services differs for at least one of the schools.


3.14.C.2 Writing Hypotheses for a Chi-Square Test for Independence

A chi-square test for independence is used to determine whether two categorical variables are associated in a single population.

The hypotheses describe whether the two variables are independent or associated.

Null Hypothesis (\(H_0\))

The two categorical variables are independent, meaning there is no association between them.

\(H_0\): There is no association between the two categorical variables (the variables are independent).

Alternative Hypothesis (\(H_a\))

The two categorical variables are associated, meaning they are not independent.

\(H_a\): There is an association between the two categorical variables (the variables are not independent).

Example

A random sample of students is classified by grade level and participation in athletics.

Hypotheses:

  • \(H_0\): Grade level and participation in athletics are independent for all students at the school.
  • \(H_a\): Grade level and participation in athletics are associated for all students at the school.

Comparing the Two Types of Hypotheses

Chi-Square Test for HomogeneityChi-Square Test for Independence
\(H_0\): No difference in the distributions across populations.\(H_0\): No association between the two categorical variables.
\(H_a\): The distributions differ across populations.\(H_a\): The two categorical variables are associated.
Compares multiple populations.Studies two variables in one population.

Important AP Exam Notes

  • For a chi-square test for homogeneity, the null hypothesis states that the distributions are the same across all populations or treatment groups.
  • For a chi-square test for independence, the null hypothesis states that the two categorical variables are independent (no association).
  • The alternative hypothesis for homogeneity states that the distributions differ.
  • The alternative hypothesis for independence states that the variables are associated (not independent).
  • Always write the hypotheses in the context of the study.
  • Chi-square hypotheses are written as statements, not symbolic equations like \(p_1=p_2\).

Common AP Exam Mistakes

IncorrectCorrect
Using \(p_1=p_2\) as the null hypothesis.Chi-square hypotheses are written as contextual statements.
Writing “the variables are equal.”State that the variables are independent or associated.
Using “associated” for a homogeneity test.Homogeneity compares distributions across populations.
Using “same distributions” for an independence test.Independence examines the association between two variables.

Example

Part A: Researchers compare the distribution of preferred college majors among students from four different high schools.

Write the null and alternative hypotheses.

Part B: A random sample of adults is classified by employment status and health insurance status.

Write the null and alternative hypotheses.

▶️ Answer / Explanation

Part A (Chi-Square Test for Homogeneity)

\(H_0\): The distribution of preferred college majors is the same for students from all four high schools.

\(H_a\): The distribution of preferred college majors differs for at least one of the high schools.

Part B (Chi-Square Test for Independence)

\(H_0\): Employment status and health insurance status are independent for adults in the population.

\(H_a\): Employment status and health insurance status are associated for adults in the population.

3.14.D.1 Conditions for a Chi-Square Test for Homogeneity or Independence

Before performing a chi-square test for homogeneity or a chi-square test for independence, you must verify that the required conditions are satisfied.

These conditions ensure that the chi-square distribution provides an appropriate model for the test statistic.

There are three required conditions.

1. Randomization Condition

The method of data collection depends on the type of chi-square test being performed.

  • Chi-Square Test for Independence: The data should be collected using one random sample from a single population.
  • Chi-Square Test for Homogeneity: The data should be collected using independent random samples from two or more populations or from a randomized experiment.

This condition ensures that the observations are representative of the population(s).

2. 10% Condition

When sampling without replacement, the sample size should be no more than 10% of the population size.

\(n\le0.10N\)

Where:

  • \(n\) = Sample size
  • \(N\) = Population size

Note: This condition is not required when the data come from a randomized experiment because treatments are randomly assigned rather than sampled from a population.

3. Expected Counts Condition

Every expected count in the two-way table must be at least 5.

Expected Count \(\ge5\)

If even one expected count is less than 5, the chi-square approximation may not be reliable.

Summary of Conditions

ConditionRequirement
RandomizationIndependence: one random sample.
Homogeneity: independent random samples or a randomized experiment.
10% Condition\(n\le0.10N\) when sampling without replacement.
Expected CountsEvery expected count must be at least 5.

Example 1: Chi-Square Test for Independence

A random sample of 250 students is selected from one high school.

Each student is classified by:

  • Grade Level
  • Participation in School Clubs

The expected counts for every cell are greater than 5.

Condition Check

  • ✔ One random sample
  • ✔ Sample size is less than 10% of the population
  • ✔ Every expected count is at least 5

Conclusion:

It is appropriate to perform a chi-square test for independence.

Example 2: Chi-Square Test for Homogeneity

A researcher randomly samples voters from three different cities to compare political party preference.

Each city’s sample is independent, and every expected count is at least 5.

Condition Check

  • ✔ Independent random samples
  • ✔ Each sample satisfies the 10% Condition
  • ✔ Every expected count is at least 5

Conclusion:

It is appropriate to perform a chi-square test for homogeneity.

Important AP Exam Notes

  • Both chi-square tests require the Randomization Condition, the 10% Condition (when applicable), and the Expected Counts Condition.
  • For a test of independence, data come from one random sample.
  • For a test of homogeneity, data come from independent random samples or a randomized experiment.
  • Every expected count must be at least 5.
  • The 10% Condition is unnecessary for randomized experiments.

Common AP Exam Mistakes

IncorrectCorrect
Checking observed counts instead of expected counts.Verify that every expected count is at least 5.
Using multiple populations for a test of independence.A test of independence uses one random sample from one population.
Using one random sample for a test of homogeneity.A test of homogeneity uses independent random samples or a randomized experiment.
Applying the 10% Condition to a randomized experiment.The 10% Condition is not required for randomized experiments.

Example

A researcher wants to determine whether political party affiliation is associated with age group.

A random sample of 600 registered voters is selected from one state.

Technology produces the following expected counts for the six cells of the two-way table:

85.2, 94.8, 102.4, 96.1, 111.5, 110.0

Determine whether it is appropriate to perform a chi-square test.

▶️ Answer / Explanation

Randomization Condition:

A single random sample was selected, so this condition is satisfied.

10% Condition:

The sample size is less than 10% of the state’s registered voters, so this condition is satisfied.

Expected Counts Condition:

All expected counts are greater than 5.

Conclusion:

All three conditions are satisfied, so it is appropriate to perform a chi-square test for independence.

Scroll to Top