The Chi-Square Test

An error occurred trying to load this video.

Try refreshing the page, or contact customer support.

Coming up next: Polygenic Traits: Definition & Examples

You're on a roll. Keep up the good work!

Take Quiz Watch Next Lesson
Your next lesson will play in 10 seconds
  • 0:02 Example Cross
  • 2:01 The Chi-Square Test
  • 2:59 Example
  • 5:41 Lesson Summary
Save Save Save

Want to watch this again later?

Log in or sign up to add this lesson to a Custom Course.

Log in or Sign up

Speed Speed Audio mode

Recommended Lessons and Courses for You

Lesson Transcript
Instructor: Kristin Klucevsek

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.

Example Cross

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?

To unlock this lesson you must be a Member.
Create your account

Register to view this lesson

Are you a student or a teacher?

Unlock Your Education

See for yourself why 30 million people use

Become a member and start learning now.
Become a Member  Back
What teachers are saying about
Try it risk-free for 30 days

Earning College Credit

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.

To learn more, visit our Earning Credit Page

Transferring credit to the school of your choice

Not sure what college you want to attend yet? has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.

Create an account to start this course today
Try it risk-free for 30 days!
Create an account