6.2 C
London
Thursday, December 19, 2024
HomeGoogle SheetsChi-Square Tests in Google SheetsChi-Square Goodness of Fit Test in Google Sheets (Step-by-Step)

Chi-Square Goodness of Fit Test in Google Sheets (Step-by-Step)

Related stories

Learn About Opening an Automobile Repair Shop in India

Starting a car repair shop is quite a good...

Unlocking the Power: Embracing the Benefits of Tax-Free Investing

  Unlocking the Power: Embracing the Benefits of Tax-Free Investing For...

Income Splitting in Canada for 2023

  Income Splitting in Canada for 2023 The federal government’s expanded...

Can I Deduct Home Office Expenses on my Tax Return 2023?

Can I Deduct Home Office Expenses on my Tax...

Canadian Tax – Personal Tax Deadline 2022

  Canadian Tax – Personal Tax Deadline 2022 Resources and Tools...

A Chi-Square Goodness of Fit Test is used to determine whether or not a categorical variable follows a hypothesized distribution.

For example, suppose a shop owner claims that an equal number of customers come into his shop each weekday.

To test this hypothesis, an independent researcher records the number of customers that come into the shop on a given week and finds the following:

  • Monday: 50 customers
  • Tuesday: 60 customers
  • Wednesday: 40 customers
  • Thursday: 47 customers
  • Friday: 53 customers

We can perform a Chi-Square Goodness of Fit Test to determine if the data is consistent with the shop owner’s claim.

This following step-by-step example shows how to perform a Chi-Square Goodness of Fit Test in Google Sheets.

Step 1: Create the Data

First, let’s input the data into Google Sheets in the following format:

Note: There were 250 customers total. If the shop owner expects an equal number to come into the shop each day then he would expect 50 customers per day.

Step 2: Calculate the Difference Between Observed and Expected Values

The Chi-Square test statistic for the Goodness of Fit test is X2 = Σ(O-E)2 / E

where:

  • Σ: is a fancy symbol that means “sum”
  • O: observed value
  • E: expected value

The following formula shows how to calculate (O-E)2 / E for each row:

Step 3: Calculate the P-Value

Lastly, we will calculate the Chi-Square test statistic along with the corresponding p-value using the following formulas:

Chi-square test in Excel

Note: The function CHISQ.DIST.RT(x, deg_freedom) returns the right-tailed probability of the Chi-Square distribution associated with a test statistic and a certain degrees of freedom. The degrees of freedom is calculated as n-1. In this case, deg_freedom = 5 – 1 = 4.

The X2 test statistic for the test is 4.36 and the corresponding p-value is 0.3595.

Since this p-value is not less than 0.05, we fail to reject the null hypothesis. This means we do not have sufficient evidence to say that the true distribution of customers is different from the distribution that the shop owner claimed.

Additional Resources

An Intro to the Chi-Square Goodness of Fit Test
Chi-Square Goodness of Fit Test Calculator
An Explanation of P-Values and Statistical Significance

Subscribe

- Never miss a story with notifications

- Gain full access to our premium content

- Browse free from up to 5 devices at once

Latest stories