Kristin has taught college Biology courses and has her doctorate in Biology.
What if you expect one thing, but get another? The chi-square test is a method of statistical analysis that can help us identify if the results from a genetic cross are simply due to chance, or if something else is happening. Learn about the chi-square test in this lesson.
Sometimes people say you should 'expect the unexpected.' Like, if you're out walking on a bright, sunshiny day, you should expect it to start pouring. But if you get the unexpected, then what? Exactly what does that mean? Is that because everything's up to just chance in the world?
When it comes to studying genetics, we believe that it's okay to expect the expected. But if you get something unexpected in your data, that can mean there is something really interesting happening. But how can you be sure if there is something interesting going on, or if it really is just chance?
Let's say you do something unexpected. You breed snakes for a living. Usually, your snakes are black. Black snakes, they sell pretty well. But one day, an egg hatches and you see a brilliant blue snake as a result of a random genetic mutation. You know this blue snake would be a hot commodity, so over the years you work on breeding this blue snake until you now have a set of black snakes and a set of blue snakes.
You are pretty sure that this blue color (big B) is dominant over black (little b) and that there's only one gene responsible for snake color. If the blue color really is dominant to black, then your background in genetics would tell you that mating two heterozygote snakes would give you a 3:1 ratio of blue to black snakes in the offspring.
With the help of some statistics alongside your genetics, we can test if this is true. To do this, you first need to make a null hypothesis, which is a statistical way of stating your prediction of the expected outcome. Once we make that prediction, we'll do some fancy math to see if we're going to accept or reject the null hypothesis.
If we accept the null hypothesis, that means we accept that any differences in expected results are due to chance. If we reject the null hypothesis, this means that it's unlikely that our results are due to chance. So let's create a null hypothesis and then test it. Your null hypothesis is that you expect a 3:1 ratio of blue to black snakes in a cross between heterozygote snakes.
The Chi-Square Test
So, how do we know if we are going to accept or reject your null hypothesis and find out if blue snakes are really dominant in phenotype to black snakes? The way to do this is by using the chi-square test. A chi-square test, otherwise known as a 'goodness-of-fit test,' is a statistical test for identifying the probability that differences between the results you observed and the results you expected are actually due to chance.
To perform a chi-square test, you'll first need the following information: the null hypothesis, expected results, the observed results from your genetic cross, and the degrees of freedom. The degrees of freedom are just the number of classes, n - 1. For us, we have two classes: black and blue. Therefore, n - 1 = 1.
Once we have our information, we'll use the formula for the chi-square test. In this formula, x^2 = the sum of the observed minus the expected values, squared, divided by the expected value for each class.
So let's go back to our snake-breeding example so we can see how this works out. Let's say you breed two snakes over time and get a total of 32 offspring. According to your null hypothesis, which states that the blue color is dominant to black, you expect a 3:1 ratio of blue to black snakes. In other words, your expected 24 blue snakes and 8 black snakes.
That's all fine and good, but 'expect the unexpected,' right? So, it turns out that when the eggs hatch, you wind up with 20 blue snakes and 12 black snakes. Now that we have these numbers, we can use them in the chi-square test equation and get a number for a value for x^2.
For blue snakes, (20 - 24)^2 / 24 = 0.66. For black snakes, (12 - 8)^2 / 8 = 2. The sum of these values is 2.66. This is the value of x^2, or the chi-square number. Now, that wasn't so bad. But what does this value mean?
Over 79,000 lessons in all major subjects
Get access risk-free for 30 days,
just create an account.
To find out, we have to use a chi-square table. Below is a portion of that table. Across the top of the table, you'll see values of probability (P). The next decision you need to make is what value of P you want to use as your level of significance. There are several values to choose from, but a popular choice among scientists is the value 0.05. So now that we've focused in on this square of the table, let's talk about what it means to us.
In the chi-square table, if our own chi-square number is less than this value, then we accept the null hypothesis. If our own chi-square number is greater than this value, then we reject the null hypothesis. So in order to accept our null hypothesis that blue color is dominant to black color, we need to see that our chi-square value is less than this number.
The value in the box below represents degrees of freedom of 1 and a probability of 0.05 is 3.841. Is our value for x^2 less or more than this value? Yes! Our value, 2.66, is less than this value in this position. It is between the column for probability of 0.9 and the column for 0.1.
Table represents degrees of freedom of 1 and a probability of 0.05 - 3.841
This means there is a 90% to 10% chance that our expected results were actually due to chance. This also means we can accept our null hypothesis at this level of significance. The difference in observed numbers from our expected numbers was likely just due to chance.
So, your breeding results support the fact that blue snake color is dominant to black snake color. This is good news for you, as you're about to populate the world with your new household pet.
In summary, the chi-square test is a statistical test for identifying the probability that a difference between the results you observed and the results you expected is due to chance. You can use a chi-square test to examine the results of a genetic cross where you get results that aren't what you expected. To do this, you must first create a null hypothesis, which is a statistical way of stating your prediction of the expected outcome.
You then need to calculate your expected values and perform the experiment to get your observed values. You also need to know the degrees of freedom, and you'll need to choose what P value, or probability value, you want to use as a level of significance. You can then use a chi-square table to accept or reject your null hypothesis.
If you use the chi-square test and calculate an x^2 value that's greater than your chi-square table value, then you reject your null hypothesis. If you calculate an x^2 value that is less than your chi-square table value, then you can accept your null hypothesis, and your observed results are likely due to chance.
When this lesson is over, you should be able to:
Define null hypothesis
Describe the need to test a hypothesis
Explain how to test a hypothesis using a chi-square table
Did you know… We have over 200 college
courses that prepare you to earn
credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the
first two years of college and save thousands off your degree. Anyone can earn
credit-by-exam regardless of age or education level.