We establish a hypothesis for the feature under investigation and then convert it to a null hypothesis. The null hypothesis states that no relationship between the two population parameters exists. We use it because it helps us see if our hypothesis has validity. It is impossible to prove something with absolute certainty. However, we can disprove a null hypothesis, which allows us to accept that our hypothesis is valid, and we use ‘confidence levels’ and ‘critical values’ to do this.
Imagine you’re investigating the size of trees in a forest and noticed differences as you moved from the outside of the forest to the centre. You saw the trees got denser closer to the centre. You want to know if the variations in the number of trees per 5m^2 are significant or random. You carried out an investigation and know if the variation is statistically significant. Below are the hypotheses you would use:- Hypothesis: The density of trees per 5m^2 increases as you towards the centre of the forest.- Null hypothesis: there is no significant variation in tree density in the forest.
The difference between expected and observed results in experiments can be described in two ways:
Statistically significant
Statistically insignificant (happened by chance)
When results are significant, this suggests that something is happening that wasn’t accounted for.
The chi-squared test is a statistical test commonly used for biological hypotheses to determine if the results are statistically significant.
We can also define our hypothesis as one-tailed or two-tailed. One-tailed hypotheses are based on uni-directional hypotheses and two-tailed on bi-directional hypotheses.
In terms of our earlier hypotheses, this would be:
One-tailed: The density of trees per 5m^2 increases towards the forest’s centre.
Two-tailed: The density of trees per 5m^2 changes towards the forest’s centre.
Fig. 1 - One-tailed and two-tailed hypotheses
Chi-squared tests should only be done using categorical data and if specific criteria are met.
Categorical data: values that can be sorted into groups or categories. It can be further divided into nominal (values you can count but not order, e.g., eye colour) and ordinal (values you can count and order e.g., house numbers).
This is different from the chi-squared contingency test, which tests for the association between two categorical variables.
What are the criteria for performing a chi-squared test?
The sample size has to be large (>20).
The data must be categorical.
Only raw counts can be used – not ratios, rates, fractions or percentages.
The comparison between theoretical (expected) and experimental (observed) results is being made.
What are the assumptions of the chi-squared test?
Additionally, the chi-squared test makes several assumptions:
The comparisons are made on random samples.
The expected count of each cell is greater than one (>1).
No more than 20% of the cells have expected counts less than 5 (<5).
How do you calculate chi-squared?
The formula looks very scary - but don’t panic! We can break it down into steps.
What is the formula for chi-squared?
In other words, chi-squared is the sum of the square of the difference between the observed values and expected values , divided by the expected values (E).
To help you understand how we would calculate the chi-squared, we will use flower phenotype as an example.
To calculate:
Obtain the expected and observed results for the experiment (as shown in the table below)
Calculate the difference between each set of results
Square each difference
Divide each squared difference by the expected value
Use the sum of these answers to obtain the chi-squared value
Table 1. Example of a table to find values for Chi-Squared calculation.
How do you calculate degrees of freedom and use a chi-squared distribution table?
The Chi-Squared test has little meaning on its own – it needs to be compared to ‘critical values’, which are found in tables or on graphs as calculated by statistical experts.
First, you must decide the confidence level you want to use. The most common is generally 95% and/or 99%, meaning for every 100 times you carried out the test, you would get chance results on five occasions or one occasion.
Table 2. Confidence, uncertainty and probability levels.
Highly confident
Very confident
Extremely confident
Confidence level
95%
99%
99.9%
Uncertainty level
5%
1%
0.1%
Probability level (p-value)
0.05
0.01
0.001
We then use the value we have obtained in the Chi-Squared test to see if the data is statistically significant. A distribution table is used for this. The distribution table relates the chi-squared value with probabilities. We also use degrees of freedom to determine the number of comparisons made.
For a chi-squared test, the degrees of freedom equal the number of categories minus one (n-1). You will also need to determine your p-value.
The degrees of freedom used for the Chi-Squared test is always n-1
Here is an example of a standard chi-squared table. You read the table by looking at the row corresponding to the degrees of freedom used in your experiment and the column corresponding to your p-value. You will find your critical value at the intersection of these rows and columns.
Table 3. Standard distribution table.
The probability that the difference between observed and expected is due to chance
Degrees of freedom
0.1
0.05
0.01
0.001
1
2.27
3.84
6.64
10.83
2
4.60
5.99
9.21
13.82
3
6.25
7.82
11.34
16.27
4
7.78
9.49
13.28
18.46
If your chi-squared test value is greater than the critical value (the value found from the table), then the deviation between your expected and observed results is statistically significant. If it is not greater than the critical value, the difference is not significant.
How is the chi-squared test used in genetics?
Chi-squared tests are used across biology. For instance, they can be very useful for determining whether the results of a genetic cross are significantly different from the theoretical predictions.
Genetic cross: The deliberate breeding of two different individuals that results in offspring that carry part of the genetic material of each parent.
Let’s take, for example, the actual results that Gregor Mendel obtained during his pea experiments on the inheritance of seed type. Mendel performed experiments on pea plants to determine patterns of inheritance for some of the plants’ observable traits. For more information on his experiments, check out our articles on Inheritance!
A single gene determines seed type with a dominant allele that produces smooth seeds and a recessive allele that produces wrinkled seeds. Mendel’s experiment resulted in 5474 smooth and 1850 wrinkled seeds. Allowing for some statistical error, how can we tell if this result fits our expected ratio?
Statistical error: The difference between a measured value and the actual value of the collected data. If the error value is more significant, the data will be considered less reliable.
When following these steps, it is useful to summarise your calculations in a table like so:
Table 4. Another example of how to obtain the values for the equation.
Category
Observed
Expected
O-E
(O-E)2
(O-E)2/E
Smooth
5474
5493
-19
361
0.0657
Wrinkled
1850
1831
19
361
0.1972
Total = 7324
0.2629
First, let’s calculate the expected values. In this case, we would find the total number of offspring (5474+1850 = 7324) and divide it according to the 3:1 ratio. This gives us expected values of (7324 x ¾ =) 5493 smooth seeds and (7324 x ¼ =)1831 wrinkled seeds.
We now need to know the difference between the observed and expected values. For the smooth category, the difference is (5474-5493 =) -19, while for the wrinkled category, the difference is (1850-1831 =) 19.
We get 361 for smooth seeds and 361 for wrinkled seeds when we square these differences.
When you square values, any negatives cancel out.
4. Finally, when we divide these values by their respective expected values, we get 0.0657 and 0.1972. Added together, this gives us 0.2629. 5. Let’s check the chi-squared distribution table above. We have two categories, which means our degree of freedom is 2-1=1. 6. To find our critical value, use the standard table from before, find the row corresponding to our degree of freedom (1) and the column corresponding to our p-value (0.05). These intersect at the critical value of 3.84. 7 . 0.2629<3.84. Therefore the observed and expected values are not significantly different from one another. The slight differences in value are due to chance.
What if the observed values are significantly different from the expected values?
Suppose the observed values are significantly different to expected values. If the result is smaller than or equal to the stated p-value, there are some things we may want to consider. As discussed in the article on sex-linkage, autosomal linkage, and epistasis, there are several reasons why we might observe patterns of inheritance that do not fit Mendelian ratios.
The trait might be sex-linked, meaning the sex of the individual affects whether they can inherit the trait.
Two genes might be found on the same chromosome and thus exhibit linkage.
Epistasis might also affect the phenotypes expressed by the individual.
Sex linkage: Sex linkage is the phenotypic expression of an allele that is dependent on the gender of the individual and is directly tied to the sex chromosomes.
Autosomal linkage: Autosomal linkage occurs if two or more genes are located on the same autosome (non-sex chromosome). The two genes are less likely to be separated during crossing over, resulting in the alleles of the linked genes being inherited together.
Epistasis: Epistasis is a circumstance where the expression of one gene is affected by the expression of one or more independently inherited genes.
Chi-Square Test - Key takeaways
The chi-squared (χ2) tests the null hypothesis that there is no statistically significant difference between the observed and expected results of an experiment.
It can be performed on large sample sizes (>20), using raw counts of categorical data.
Chi-squared is the sum of the square of the difference between the observed and expected values, divided by the expected values.
A chi-squared distribution table is used to determine the correct critical value for the given degrees of freedom and p-value.
When chi-squared is higher than the critical value, the difference between the expected and observed results is significant.
Degrees of freedom are calculated by subtracting one from the number of categories.
Learn faster with the 0 flashcards about Chi-Square Test
Sign up for free to gain access to all our flashcards.
Frequently Asked Questions about Chi-Square Test
What is chi-square in genetics?
A chi-squared test is used to see if the difference between the observed and expected results of an experiment is statistically significant. Chi-squared tests are often used on biological data.
How do you determine the degrees of freedom?
The degrees of freedom are equivalent to the number of categories (n) minus one. df = n-1
How do you calculate the chi square test?
The chi-squared test is calculated with the equation
What is a chi-square test used for in biology?
To identify if results are statistically significant when comparing observed and expected results.
When would you do a chi-square test?
When we are comparing observed and expected results.
How do you interpret a chi-square test?
We use the value we have obtained in the Chi-Squared test to see if the data is statistically significant. A distribution table is used for this. The distribution table relates the chi-squared value with probabilities. We also use degrees of freedom to determine the number of comparisons made.
How we ensure our content is accurate and trustworthy?
At StudySmarter, we have created a learning platform that serves millions of students. Meet
the people who work hard to deliver fact based content as well as making sure it is verified.
Content Creation Process:
Lily Hulatt
Digital Content Specialist
Lily Hulatt is a Digital Content Specialist with over three years of experience in content strategy and curriculum design. She gained her PhD in English Literature from Durham University in 2022, taught in Durham University’s English Studies Department, and has contributed to a number of publications. Lily specialises in English Literature, English Language, History, and Philosophy.
Gabriel Freitas is an AI Engineer with a solid experience in software development, machine learning algorithms, and generative AI, including large language models’ (LLMs) applications. Graduated in Electrical Engineering at the University of São Paulo, he is currently pursuing an MSc in Computer Engineering at the University of Campinas, specializing in machine learning topics. Gabriel has a strong background in software engineering and has worked on projects involving computer vision, embedded AI, and LLM applications.
Vaia is a globally recognized educational technology company, offering a holistic learning platform designed for students of all ages and educational levels. Our platform provides learning support for a wide range of subjects, including STEM, Social Sciences, and Languages and also helps students to successfully master various tests and exams worldwide, such as GCSE, A Level, SAT, ACT, Abitur, and more. We offer an extensive library of learning materials, including interactive flashcards, comprehensive textbook solutions, and detailed explanations. The cutting-edge technology and tools we provide help students create their own learning materials. StudySmarter’s content is not only expert-verified but also regularly updated to ensure accuracy and relevance.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.