The CHIDIST function in Google Sheets is useful when you need to calculate the right-tailed chi-squared distribution of a given input.
The chi-squared distribution is often used in hypothesis testing. It is often used to test the goodness of fit of a distribution of data and whether data series are independent.
The rules for using the
CHIDIST function in Google Sheets are as follows:
- The function requires two arguments: the input of the probability distribution function and the degrees of freedom.
- The function then outputs the value of the right-tailed chi-squared distribution.
Let’s begin with a quick use case.
In this example, let’s say we would like to figure out whether a particular ad is more effective for a particular gender. Ad analytics was able to give us a dataset of 180 users, with 100 male participants and 80 female participants. We have data on which ads they decided to click. Is it possible to determine whether gender has a significant effect on whether the user decides to click the advertisement.
CHIDIST function, we can easily compute the probability that the results follow a random distribution or are skewed in a particular way. The probability for dependence is usually a probability less than 0.05. If the result of
CHIDIST is less than 0.05, this means there is a significant dependence between the variables.
Now that we’ve seen an example of when to use the
CHIDIST function, let’s explore how to set up this function.
The Anatomy of the CHIDIST Function
The syntax of the
CHIDIST function is as follows:
Let’s look at each term to understand what they mean.
- = the equal sign is the indicator that we’ll be using a function in Google Sheets.
- CHIDIST() is our
CHIDISTfunction. It computes the right-tailed chi-squared distribution.
- x refers to the input of the chi-squared probability distribution function.
- degrees_freedom refers to the number of degrees of freedom of the distribution.
- The argument x must have a positive value.
CHIDISTwill truncate the degrees_freedom argument to an integer if a non-integer is given.
- The degrees_freedom argument must have a value of at least 1 and must be less than 10^10.
A Real Example of Using CHIDIST Function
Let’s look at an example of the
CHIDIST function being used in a Google Sheets spreadsheet.
In the table below, we computed for the chi-square of the dataset as seen in cell B6. The chi-square value was computed by using the formula seen in column D. The observed result refers to the actual observed users who fall into that category. Meanwhile, the expected results refer to the expected distribution for each category (assuming no dependence).
To calculate the value seen in cell B7, we can use the following formula:
The ‘1’ in the formula above refers to the degrees of freedom of the given dataset. The degrees of freedom can be computed using the following formula: (rows − 1) × (columns − 1). In this case, we only have two “rows” (male and female) and two columns (clicked and did not click the ad).
If you would like to work with a copy of the spreadsheet above, use the link below to create your own copy.
In the next section, we’ll follow a step-by-step guide on how we can begin writing the
CHIDIST function in Google Sheets.
How to Use CHIDIST Function in Google Sheets
- Given a dataset, it’s important to set up the table to get the chi-square result easily. Aligning the categories with two columns for observed and expected results will help us compute the chi-square test. In this example, we’ve arrived at a chi-square test result of 10.25.
- Select the cell where we will put our function’s output. In this example, we’ll return the
CHIDISToutput in cell B7.
- In the selected cell, type in the equal sign followed by ‘CHIDIST(‘.
- A tooltip box appears with tips on how to use the
CHIDISTfunction. We can click on the arrow in the top-right-hand corner of the box to remove it from view if needed.
- Next, we need to add in our arguments. We know the chi-square test result, as well as the degrees of freedom.
Once you’ve added your arguments, hit Enter to evaluate the function.
In this particular example, we have a probability that is much less than 0.05. This makes it likely that there is a relationship between gender and the click rate of this particular ad.
Frequently Asked Questions (FAQ)
- Why does my formula return a #VALUE! error?
All arguments for the
CHIDISTfunction must be numeric. Non-numeric values will lead to a
#VALUE!error in your result.
- Why does my formula return a #NUM! error?
Make sure that the value of x is greater than 0. Also, make sure that the degree_freedom argument is not less than 1 or higher than 10^10.
Following this guide should show how easy it is to find the right-tailed chi-squared distribution of two variables. We can use the
CHIDIST function to determine dependence between variables in your dataset easily.
You can now use the
CHIDIST functions in Google Sheets together with the various other Google Sheets formulas available to create powerful spreadsheets that are easy to set up.
Make sure to subscribe to our newsletter to be the first to know about the latest guides and tutorials about Google Sheets.