Chi-squared test

Biology · Foundations

Question 1 of 10

0

    A chi-squared test compares observed and expected results across 3 habitats where a species was counted. How many degrees of freedom does the test have?

    Decimals (0.75 or 0,75), fractions (3/4) and mixed numbers (1 1/2) are accepted. Do not use thousands separators.

    How to type your answer
    • Fractions: 3/4. Mixed numbers: 1 1/2.
    • Decimals with a point or a comma: 0.75 or 0,75.
    • Negative numbers start with a minus: -3/4.
    • Percentages need the % sign: 75%.

    Stuck? Read the explanation

    Unlocks at a streak of 5 correct answers in a row.

    Print a free worksheet (PDF)

    Embed this practice on your site or class page

    Paste this HTML into your page. Students practise right there; it is free and needs no account.

    Chi-squared test explained

    The chi-squared test checks whether the difference between observed results and expected results is likely to be due to chance. It starts from a null hypothesis, which states that there is no real difference, and the expected values are the values predicted by that hypothesis.

    The test statistic is:

    χ2=∑(O−E)2E\chi^2 = \sum \frac{(O - E)^2}{E}

    Here OO is the observed frequency and EE is the expected frequency. Square the difference so that negative and positive differences do not cancel.

    The degrees of freedom are needed to find the critical value. For a goodness-of-fit test, df=n−1df = n - 1, where nn is the number of categories. For a contingency table, df=(rows−1)(columns−1)df = (\text{rows} - 1)(\text{columns} - 1).

    Compare the calculated value with the critical value at the chosen significance level, usually 5%. If the calculated value is greater than the critical value, reject the null hypothesis. If it is smaller, there is not enough evidence to reject it.

    Worked example

    A die is rolled 60 times, so each face is expected 10 times. The observed counts for faces 1 to 6 are 8, 12, 9, 11, 7 and 13.

    1. χ2=(8−10)210+(12−10)210+(9−10)210+(11−10)210+(7−10)210+(13−10)210=2810=2.8\chi^2 = \dfrac{(8-10)^2}{10} + \dfrac{(12-10)^2}{10} + \dfrac{(9-10)^2}{10} + \dfrac{(11-10)^2}{10} + \dfrac{(7-10)^2}{10} + \dfrac{(13-10)^2}{10} = \dfrac{28}{10} = 2.8.
    2. The die has 6 categories, so df=5df = 5.
    3. The critical value at the 5% level for df=5df = 5 is 11.07011.070.
    4. Since 2.8<11.0702.8 < 11.070, the difference is not significant. There is no evidence that the die is biased.

    What you will practise

    New numbers every time you practise. Levels: Easy, Medium, Hard. Each answer is followed by a worked explanation.

    Example questions

    • Easy

      In a breeding experiment with tall and dwarf pea plants, the expected phenotypic ratio tall : dwarf is 1 : 1. A total of 200 offspring are counted. Calculate the expected number of dwarf offspring.

    • Medium

      Limpets counted on different zones of a rocky shore were counted in 2 equal areas, with the same number expected in each. Observed numbers: 10, 10. Expected numbers: 10, 10. Use χ² = Σ (O − E)² ÷ E to calculate the chi-squared value. Give your answer to 2 decimal places.

    • Hard

      In a pea plant cross for seed shape and colour, the expected phenotypic ratio round yellow : round green : wrinkled yellow : wrinkled green is 9 : 3 : 3 : 1. A total of 320 offspring are counted. Observed numbers: 184, 59, 55, 22. Calculate the chi-squared value using χ² = Σ (O − E)² ÷ E, with expected numbers worked out from the ratio. Give your answer to 2 decimal places.