Log in Sign up
Back to Discover
🔢

Chi-squared test

math Maturity 11-13

We can check if things match.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
We look at what we see. We also look at what we expect. Do they look the same? This helps us learn. Can you find patterns too?

35 words

Sometimes we want to know if things match.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
We look at what we see. We also look at what we expect to see. Karl Pearson made a test for this. It helps us see if groups are different. It works best with large groups. If groups are too small, we use a different test. It can even help us read secret codes. This test helps us find truth in data.

72 words

Imagine you have a plan for how things should look. You expect to see a certain number of red apples and green apples. But when you look, you see something different. How do you know if the difference is just luck?

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png

Karl Pearson made a way to solve this puzzle. It is called the chi-squared test. This test looks at groups of things. It compares what we see to what we expect. We call what we see "observed" numbers. We call what we think should happen "expected" numbers.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png

Pearson shared this idea in 1900. It is a big part of modern math. The test works best when we have many items to count. If the groups are very small, scientists use a different test. One such test is called Fisher's exact test.

This math helps in many ways. People use it to study genes in biology. It can even help people read secret codes. It helps us see if two things are linked. For example, it can show if a neighborhood affects a person's job. The test helps us find real patterns in a sea of data.

191 words

Imagine you are looking at a large group of people. You want to know if where they live affects their jobs. You might expect that people in different neighborhoods have similar types of work. To find out, you collect data and put it into a table. This table shows how many people have certain jobs in each area.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
The chi-squared test is a way to check your guess. It helps you decide if the patterns you see are real or just luck. This math is very useful when you have many different categories to count. It is a special tool used to study how things relate to each other.

To use this test, you first need two sets of numbers. The first set is called the observed frequencies. These are the actual counts you found when you did your study. The second set is called the expected frequencies. These are the counts you would expect to see if there was no connection between the groups.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
You compare these two sets of numbers to find the difference. You look at how much the real numbers stray from the expected numbers. If the difference is very large, it suggests a real pattern exists. The test uses a specific math rule to turn these differences into one number. This number is called the test statistic.

This method was created by a mathematician named Karl Pearson. In the 19th century, most scientists assumed data followed a very smooth, normal pattern. However, Pearson noticed that biological data was often skewed or uneven.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
He published a famous paper in 1900 about this new test. This paper became a foundation for modern statistics. Pearson also created the Pearson distribution to model many different types of data. His work helped scientists understand data that did not fit the old rules. For a while, his ideas caused some debate among other mathematicians.

There are many ways to use these types of tests today. Some researchers use a version called Fisher's exact test. This is better when the groups you are counting are very small.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
Another person, Frank Yates, suggested a way to make the test more accurate. He created a correction to reduce errors in the math. In biology, scientists use these tests to study genes and mutations. In the world of secrets, people use them in cryptanalysis. This helps them compare plain text to secret coded messages. They can tell if a code has been broken successfully.

Even though this test is helpful, it has some limits. It works best when the groups are large and independent. If the groups are too small, the results might not be right.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
The test also tells you if a relationship exists, but not how strong it is. You might need other tools, like Cramér's V, to see the strength. It is also important to remember that large groups can make tiny differences look important. Scientists must be careful when they look at their results. Using the right test ensures that the discoveries are truly meaningful.

514 words

The chi-squared test is a fundamental statistical hypothesis test used to analyze categorical data. It is primarily applied to contingency tables, which are grids used to organize data into different categories. Scientists use this test to determine if two categorical variables are independent or if they influence one another. For example, a researcher might use it to see if a person's neighborhood is related to their job type. The test evaluates how likely the observed data is if we assume there is no relationship between the variables. This assumption is known as the null hypothesis.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png

To perform the test, a researcher must compare two sets of values: observed frequencies and expected frequencies. Observed frequencies are the actual counts collected from a sample. Expected frequencies are the counts one would anticipate if the null hypothesis were true. The test calculates the difference between these two sets for every category in the table. This difference is squared to ensure all values are positive. These squared differences are then divided by the expected values. Finally, the researcher sums these results to produce a single value called the test statistic. If this statistic is improbably large, the researcher rejects the null hypothesis, suggesting a real relationship exists.

There are different types of chi-squared tests depending on the research goal. Pearson's chi-squared test is the standard version used for testing goodness of fit or independence. It works best when sample sizes are large. If the sample sizes are small, researchers often use Fisher's exact test instead. Another version is the Cochran–Mantel–Haenszel chi-squared test. There is also McNemar's test, which is used for specific tables containing paired observations. Additionally, Yates's correction for continuity can be applied to reduce errors. This correction subtracts 0.5 from the absolute difference between observed and expected values to adjust the final statistic.

Modern statistics owes much of its structure to the work of Karl Pearson. In the 19th century, researchers like Sir George Airy and Mansfield Merriman assumed biological data followed a normal distribution. However, Pearson noticed that many biological observations showed significant skewness. In a series of articles published between 1893 and 1916, he developed the Pearson distribution. This family of continuous probability distributions can model both normal and skewed data. In 1900, Pearson published his paper on the chi-squared test, which became a foundation of modern statistics. His ideas regarding the distribution of the test statistic caused controversy that lasted for 20 years until it was settled by R.A. Fisher in 1922 and 1924.

The test is highly significant in many scientific fields. In bioinformatics, it is used to compare the distribution of gene properties, such as mutation rates or genomic content. Researchers use it to see if certain genes belong to specific categories, like disease genes or essential genes. In the field of cryptanalysis, the test helps compare the distribution of plaintext and decrypted ciphertext. A low chi-squared value in this context indicates that a decryption was likely successful. The test also has specific mathematical applications, such as testing if the variance of a normally distributed population matches a specific value. For instance, in a sample of size 21, an acceptance region for a 5% significance level falls between 9.59 and 34.17.

Despite its utility, the chi-squared test has several important limitations. It requires that all observations are independent, and violating this assumption can lead to misleading conclusions. The test is also very sensitive to sample size. In very large samples, even tiny, trivial differences can appear statistically significant. Conversely, in very small samples, the test may lack the power to detect real associations. It is also important to note that the test only indicates if a relationship exists. It does not measure the strength or practical importance of that relationship. To find the strength, researchers should report effect size measures like Cramér’s V or the contingency coefficient.

Understanding the chi-squared test requires recognizing how it connects to broader statistical concepts. It is a type of nonparametric statistic, meaning it does not assume the data follows a specific distribution like the normal distribution. It also relates to the concept of homogeneity, which tests if proportions are the same across different groups. While the test assumes a continuous distribution can approximate discrete binomial frequencies, this is not perfectly accurate. This is why researchers must be cautious when expected frequencies in any category are very small. Generally, it is recommended that expected frequencies be at least 5 to ensure accuracy.

Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png

744 words
🖼️ Images & Media (1)
File:Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
Up Next
🔢
Statistical hypothesis test
Math
More to explore

What is Nepedia?

A free, ad-free encyclopedia for children. Every article is written at five reading levels, so the same page works for a five-year-old and a fifteen-year-old — use the level switcher above to see this one change. No account needed to read.