Nepedia
Back to Discover
Advanced Reader
🔢

Chi-squared test

math Maturity 11-13 Next article →

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
Chi-square distributionCDF-English

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
Chi-square distributionCDF-English
760 words

Where will your curiosity go next?

Keep exploring at your chosen reading level.

🖼️ Images & Media (1)
File:Chi-square distributionCDF-English.png
Chi-square distributionCDF-English.png
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.