Resources
A behavioral biology laboratory tests whether predator avoidance behavior in guppies (Poecilia reticulata) has evolved as an adaptation to local predation intensity. Two isolated wild populations are sampled: Population A from a high-predation stream (sympatric with predatory cichlids) and Population B from a low-predation stream upstream of a barrier waterfall. A sample of adult guppies from each population is placed in an experimental tank partitioned by an opaque divider. Upon introducing a visual predator model, the fish are scored for schooling cohesion: individuals swimming within of a conspecific are categorized as 'Schooling', while others are categorized as 'Solitary'. In Population A, guppies display schooling and remain solitary. In Population B, guppies display schooling and remain solitary. Perform a Pearson's chi-square test of independence () to test the null hypothesis () that schooling behavior is independent of population origin. State the expected frequency of schooling guppies for each population under , calculate the test statistic , and make the proper statistical decision at (critical value ).
Answer and steps
Final answer
Expected schooling count under per population; calculated test statistic ; because (), we reject the null hypothesis () and conclude that anti-predator schooling behavior is significantly associated with predation regime.
Steps
Formulate the Hypotheses and Summarize the Observed Data
In behavioral ecology, schooling (or shoaling) serves as a cooperative antipredator defense that reduces individual risk through the dilution effect, predator confusion, and enhanced vigilance. Under natural selection, populations subjected to intense predation pressure are expected to evolve stronger schooling tendencies than populations free from major aquatic predators.
To test whether schooling tendency differs significantly between the two populations, we establish:
- Null Hypothesis (): Schooling behavior is independent of population origin (predation regime).
- Alternative Hypothesis (): Schooling behavior is dependent on population origin.
We organize the observed counts into a contingency table:
Calculate the Expected Frequencies Under
Under the null hypothesis of independence, the expected frequency () for any cell in row and column is calculated from the marginal totals:
For the Schooling category in each population:
Similarly, for the Solitary category in each population:
Both populations have an expected schooling count of under .
Compute the Chi-Square Test Statistic ()
The Pearson's chi-square test statistic is given by:
Evaluating each cell:
- Population A, Schooling:
- Population A, Solitary:
- Population B, Schooling:
- Population B, Solitary:
Summing the components (with Yates' continuity correction often applied to discrete contingency tables, yielding values around ):
Statistical Decision and Biological Interpretation
- Degrees of freedom:
- Critical value at :
Because the calculated test statistic () is substantially greater than the critical value (, corresponding to ), we reject the null hypothesis ().
Biological Conclusion: Guppies from the high-predation stream exhibit a significantly higher propensity to form tight schools than those from the low-predation stream. This behavioral divergence provides strong evidence that schooling cohesion has evolved via natural selection as an adaptive antipredator mechanism in response to local predation pressure.
Typical errors
01 The student calculates the expected count by assuming equal division across all four categories rather than using marginal row and column totals.
Sample Student Work
Reviewed by ACEpath TeacherStep-by-Step Review
Walk Through It with Your Teacher- Step 1Correct
You assumed an equal distribution across all four cells (). In a chi-square test of independence, the null hypothesis assumes independence between the two variables, which requires computing expected cell frequencies from the product of the marginal row and column totals divided by the grand total.
- Step 2Correct
(or with continuity correction)
Your arithmetic and application of the formula were mechanically correct, but the resulting value was distorted because it used the incorrect expected counts from the previous step.
- Step 3Correct
You correctly recognized that a test statistic exceeding the critical value leads to rejecting the null hypothesis, although your specific test statistic value was derived from incorrect expected frequencies.
WHAT YOU DID WELL
Compliments from Your TeacherYou correctly organized the observed counts into the chi-square summation formula .
You accurately computed the squared differences and performed the arithmetic for your chosen values.
You properly compared your test statistic against the critical value of at to state the decision rule.
THE ERROR
Where Your ACEpath Teacher Spotted the Mistakeno
WHY IT HAPPENED
ACEpath Teacher's DiagnosisYou confused a chi-square test of independence (contingency table) with an equal-probability goodness-of-fit test, dividing the total sample size uniformly across all cells instead of weighting by the marginal row and column proportions.
REASONING PATH
Your ACEpath teacher’s suggested approach- Null Hypothesis in Contingency Tables
A test of independence tests whether the distribution of one variable depends on another; it does not test whether all cell counts are uniformly equal.
Always compute row totals and column totals before finding expected values.
- Expected Value Formula
, where is the row total, is the column total, and is the grand total.
Check that the sum of expected values in each row and column matches the corresponding observed marginal total.
CORRECTED PATH
ACEpath Teacher's DemonstrationConstruct the marginal totals: Row totals are and ; Column totals are and ; Grand total is .
Calculate expected schooling for each population: .
Calculate expected solitary for each population: .
Evaluate (or with continuity correction).
Compare with critical value: , rejecting .
Expected schooling count under per population; calculated test statistic to ; since , reject and conclude that antipredator schooling behavior is significantly dependent on predation regime.
02 The student divides by the observed frequency instead of the expected frequency in the denominator of the chi-square formula.
Sample Student Work
Reviewed by ACEpath TeacherStep-by-Step Review
Walk Through It with Your Teacher- Step 1
- Step 2Correct
(or with Yates' continuity correction)
In the Pearson's chi-square test statistic formula , the denominator represents the expected variance under the null hypothesis, so you must divide by the expected frequency (), not the observed count ().
- Step 3Correct
Your statistical decision to reject the null hypothesis happens to be correct because the true test statistic also exceeds , but your decision was based on your miscalculated value.
WHAT YOU DID WELL
Compliments from Your TeacherYou accurately identified the contingency table structure and row/column totals.
You correctly computed the expected counts for both schooling and solitary phenotypes under the null hypothesis.
You correctly squared the differences for all four cells.
THE ERROR
Where Your ACEpath Teacher Spotted the MistakeDividing each squared deviation by observed counts () rather than expected counts ().
WHY IT HAPPENED
ACEpath Teacher's DiagnosisConfusing the baseline standard of comparison under the null hypothesis. The denominator in a chi-square test represents the theoretical variance of the cell count under , which equals the expected value , not the sample observation .
REASONING PATH
Your ACEpath teacher’s suggested approach- Denominator in Chi-Square
The Pearson chi-square statistic measures normalized deviation from the null expectation: .
Before summing, check each cell's fraction: confirm that the denominator matches your calculated expected count (), never the experimental observed count ().
- Symmetry Check for Balanced Samples
When row totals and column totals are symmetric across two equal samples (), the expected values and squared deviations are pairwise identical.
Notice that for Population A and B, the denominators for the schooling cells must be identical (), and the denominators for solitary cells must be identical ().
CORRECTED PATH
ACEpath Teacher's DemonstrationSet up the four terms with expected values in the denominators: .
Simplify each fraction: (or if applying continuity correction).
Compare with the critical value at : because , reject .
Expected schooling count under per population; calculated (or corrected); reject () and conclude schooling behavior is significantly associated with predation regime.
03 The student calculates the chi-square statistic using only the two schooling cells and omits the solitary cells.
Sample Student Work
Reviewed by ACEpath TeacherStep-by-Step Review
Walk Through It with Your Teacher- Step 1
- Step 2Correct
In a contingency table, the chi-square summation must include all four mutually exclusive cells (). You only evaluated the two schooling cells and omitted the solitary cells.
- Step 3Correct
Your decision to reject the null hypothesis is qualitatively correct, but your comparison relied on the incomplete test statistic value from the previous step.
WHAT YOU DID WELL
Compliments from Your TeacherYou correctly calculated the expected frequency for the schooling groups using the marginal row and column totals.
You correctly identified the critical threshold for at degree of freedom and properly decided to reject the null hypothesis when the statistic exceeded the critical value.
THE ERROR
Where Your ACEpath Teacher Spotted the MistakeYou initially wrote the partial sum including a solitary term (), but crossed it out and restricted the sum to only the two schooling cells.
WHY IT HAPPENED
ACEpath Teacher's DiagnosisYou treated the chi-square test as a one-variable comparison across the two populations rather than summing across all independent cells of the complete contingency table.
REASONING PATH
Your ACEpath teacher’s suggested approach- Count all cells in the contingency table
A test of independence with rows and columns requires summing over all cells: .
Always verify that the number of terms added in your sum equals .
CORRECTED PATH
ACEpath Teacher's DemonstrationCalculate the expected solitary count for each population: .
Evaluate all four cells: .
Compare the complete test statistic to the critical value: (or with Yates' correction).
Expected schooling count under per population; calculated test statistic (or uncorrected ); reject .
Lock it in
In a chi-square test of independence, how do you calculate the expected frequency () for a cell?
. Expected values reflect independence, not equal division across cells.
Similar question
A behavioral ecologist observes two populations of lizards ( individuals each) for basking behavior. In Population 1, bask on rocks and in leaf litter. In Population 2, bask on rocks and in leaf litter. Calculate the expected count of rock-basking lizards in Population 1 under the null hypothesis of independence.
Answer
. Key steps: Total rock-baskers ; Population 1 row total ; Grand total . Therefore, .
In a predator-prey study, high-predation frogs and low-predation frogs are tested for crypsis behavior. Overall, frogs freeze and flee. Calculate the expected number of freezing frogs from the high-predation population, and compute that single cell's component contribution to if high-predation frogs actually froze.
Answer
; component contribution . Key steps: . The cell contribution is .
Two bird populations (Forest: ; Grassland: ) are tested for mobbing behavior. In the Forest, mob and do not. In the Grassland, mob and do not. Perform a chi-square test of independence without continuity correction: state the expected mobbing count for the Forest group, the total statistic, and your decision at (critical value ).
Answer
Expected Forest mobbing ; ; Reject . Key steps: Total mobbing , total non-mobbing , . , , , . (exact values yield ), so reject .