Chi-Squared Tests in Ecology The Chi-Squared Test (2) • The chi-squared test is used to study differences between data sets. • It is only used for frequencies (counts), never for measurements. • It is used to compare an experimental result with an expected theoretical outcome. • It is not a valid test for small sample sizes (n<20) • It tests the validity of the null hypothesis: no difference between groups of data. • In ecology, chi-squared tests are used to study habitat preference. Mangrove (Avicennia marina var. resinifera) Mangroves are doing well in USA these days… Mangrove forests vs shrimp farming Pneumatophores • Some plants have aerial roots – pneumatophores • These can come in handy in waterlogged soil where oxygen levels are very low… Soil porosity is related to the average size of soil particles… • Larger particles, like sand, have larger spaces for air • Clay soils have very tiny particles, much smaller spaces for air Experimental Design • 1 m x 1 m quadrats were placed around many mangroves in numerous locations. • Pneumatophores were counted. • Chi-squared test was use to compare observed results for pneumatophore density. • Null hypothesis: no difference in density between substrates (soils) The Flat Periwinkle (Littorina littoralis) Periwinkles feed on a number of seaweed species Food preference is a form of animal behavior • Using quadrats, the number of periwinkles associated with each seaweed species was recorded. State your null hypothesis for this investigation (H0) • H0: There is no difference between the numbers of periwinkles associated with different species. • What is the alternative hypothesis (HA)? • HA : There is a real difference between numbers of periwinkles associated with different species. Use the chi-squared test to determine if the observed differences are significant or if they can be attributed to chance alone. Enter the observed values and calculate the chisquared value Here’s how you do it… • The expected value (E) would be the mean number of periwinkles associated with the four seaweed species. Now Complete the Chart… • Calculate the degrees of freedom: • 4-1 = 3 Check your Chi-square table for 3 degrees of freedom. • 57.4 >> 7.82, 11.34 • Is H0 accepted or rejected? • There is a significant difference in feeding preferences of periwinkles. Woodlice (Pillbugs) Experiment Category Dry Humid O 15 35 E 25 25 O-E -10 +10 (O-E)2 100 100 Chi-squared value is 8 for 1DF (O-E)2/E 4 4 Chi-Square Homework Worksheet • A marketing analyst wishes to see whether consumers have any preference among five flavors of a new fruit candy. • A random sample of 100 people provided the following data. Flavor Preference Cherry 32 Strawberry 28 Orange 16 Lime 14 Grape 10 What is the null hypothesis? • How do you calculate your expected value? • How many degrees of freedom do you have? • Show your chi-square calculations below, and state whether the null hypothesis is accepted or rejected. Flavor Preference Cherry 32 Strawberry 28 Orange 16 Lime 14 Grape 10 A science teacher living in the desert noticed that native mesquite trees differed in terms of number of parasitic mistletoe plants they contained. Mesquite trees in residential neighborhoods tended to have fewer parasitic plants than trees found in undisturbed areas. • RESEARCH QUESTION: Is there really more mistletoe in the undisturbed areas than in his neighborhood? • What is his hypothesis? Mesquite and Mistletoe Tree # 1 2 3 4 5 6 7 8 9 10 “wild” trees 26 11 16 9 3 14 5 8 14 15 Residential trees 6 8 1 0 0 0 3 3 3 1 Here is his data. Calculate the chi-squared value for the null hypothesis.