Workshop 11.2a - χ2 tests
23 April 2011
Basic χ2 references
- Logan (2010) - Chpt 16-17
- Quinn & Keough (2002) - Chpt 13-14
Goodness of fit test
A fictitious plant ecologist sampled 90 shrubs of a dioecious plant in a forest, and each plant was classified as being either male or female. The ecologist was interested in the sex ratio and whether it differed from 50:50. The observed counts and the predicted (expected) counts based on a theoretical 50:50 sex ratio follow.
Format of fictitious plant sex ratios - note, not a file | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Expected and Observed data (50:50 sex ratio).
|
Note, it is not necessary to open or create a data file for this question.
- First, what is the
appropriate test
to examine the sex ratio of these plants?
- What null hypothesis is being tested by this test?
- What are the degrees of freedom are associated with this data for this test?
- Perform a Goodness-of-fit test
to test the null hypothesis that these data came from a population with a 50:50 sex ratio (hint). Identify the following:
Show code> chisq.test(c(40, 50))
Chi-squared test for given probabilities data: c(40, 50) X-squared = 1.111, df = 1, p-value = 0.2918
- X2 statistic
- df
- P value
- What are your conclusions (statistical and biological)?
- Using the same observed data,
test the null hypothesis
that these data came from a population with a 30:70 sex ratio (hint).
From a 30:70 female:male sex ratio, what are the expected frequency counts of females and males from 90 individuals and what is the X2 statistic?.
Show code> chisq.test(c(40, 50), p = c(0.3, 0.7))
Chi-squared test for given probabilities data: c(40, 50) X-squared = 8.942, df = 1, p-value = 0.002787
> chisq.test(c(40, 50), p = c(0.3, 0.7))$exp
[1] 27 63
- Expected number of females
- Expected number of males
- X2 statistic
- Do the plant ecologist's data dispute the findings of the other studies? (y or n)
Lets now extend this fictitious endeavor. Recent studies on a related species of shrub have suggested a 30:70 female:male sex ratio. Knowing that our plant ecologist had similar research interests, the authors contacted her to inquire whether her data contradicted their findings.