Coin Flip Chi-Square

The Chi-Square Goodness of Fit test is often the gateway to inferential statistics in high school. It appears in both the AP Biology and AP Statistics classes and is a hypothesis test for which the test statistic can be easily calculated by hand even for datasets with a large number of samples. For these reasons, it is often the way that high school students get introduced to the concept of testing a null hypothesis. Students around the world will learn to plug and chug with this equation in preparation for the upcoming AP exams, but will they really understand the mechanics of how the math works to help us to draw a conclusion from our data? Perhaps this will help.  

IMG_0999.JPG

Animated Chi-Square Goodness of Fit Calculation

 

Background

In this activity students were learning about probability. A teacher asked her students to conduct 100 coin flips. For each flip they recorded the result and produced this dataset.

At the conclusion of the data collection one student concluded that, "This coin is rigged! That seems like more heads then we would get by chance."

What do the data show? Was this coin rigged?

What would a scientist conclude?

The Chi-Square Goodness of Fit is a statistical test that can be used to test whether the frequency of specific outcomes or observations is significantly different from the expected frequency of outcomes if determined solely by random chance. It can be used when we have a categorical dependent variable of interest with two or more values. In this activity, our dependent variable is “Result” which has two possible values (Head or Tail). The Chi-Square Goodness of Fit test can only be used when our data are of this type.

 

Activity

When looking at the data table for this activity notice that the data have been organized in Tidy Format where each row represents an independent observation (single coin flip) and each column represents a single variable (Coin Flip #, Result). The dataset is called is listed as: Is this coin fair? (Chi-square).

1) Click the Interactive Analysis button located near the top right of the screen with the gear brian icon on it. This will bring up a specific checklist that will help you determine if your dataset and variable(s) of interest are a good fit for the Chi-Square Goodness of Fit animated hypothesis test. Note that an animated t-test is also available for use with other datasets. In this example you can simply click OK in the lower right to move on with the test.

2) Give your analysis a title. This will become the name of the file where your work is saved. Type this into the top field in the pop-up window.

3) State your research question. Note that the computer will suggest a research question based on the variable that you identify as your dependent variable. In this case the variable called Result is the dependent variable and the suggested question is:

Are the counts as expected across all categories of Result?

That is the very specific question which the Chi-Square test will help you to answer with your data. Put that into your own words or add to it in the field within the pop-up window.

4) Once you enter the Interactive Analysis, note that the dialogue on the upper right will help you think through each step of the calculation and give instructions. The left half of the screen will use animations to show how your data are tied to the calculations.

The lower right portion of the screen is the Notebook that will create a record of your work and calculations. When finished you can turn it into a PDF or download it as a Word doc that can also be opened as a Google Doc. If your teacher created this assignment in Google Classroom, the Publish button will automatically turn it in as a completed assignment.

6) What is your conclusion? Do these data lead us to reject the null hypothesis that we expect a 50/50 distribution of heads and tails? How do you interpret the P-value obtained with this dataset? Would a scientist conclude that the coin was rigged?

 

Screen Shot 2020-05-04 at 10.02.37 PM.png

Extension activity

7) Upload your own dataset and repeat this exercise with a dataset of your choosing. Here are instructions to Fetch a dataset from Google Sheets, or to upload an Excel or .csv file.

 

Extra resource

Former high school science teacher, biologist, and the creator of DataClassroom, Aaron Reedy, can walk you through the animated chi-square test in this 20-minute video. It was recorded for teachers, but it is relevant for students as well.

https://about.dataclassroom.com/new-how-to/2020/4/15/chi-square-goodness-of-fit-test-explained