12

Click here to load reader

Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species

  • Upload
    ngothu

  • View
    213

  • Download
    1

Embed Size (px)

Citation preview

Page 1: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species

Chi-Squared Test Activity

BackgroundSpringtails and pill bugs are two very widespread arthropods that make their home in soil. Both are evolutionary misfits. Though they are often mistaken for insects by the uninitiated, their phylogenetic tree reveals that neither are closely related to insects. There are many species of springtail that live all over the world. Pill bugs, on the other hand, are a kind of terrestrial crustacean. That’s right – pill bugs are more closely related to lobsters and crabs than ants and beetles! An aquatic ancestor of the pill bug one day made its way onto land and gave rise to a terrestrial lineage. There are dozens of separate species of pill bugs today, all classified in the family Armadillidiidae. The best-known species is the Armadillidium vulgare, the common pill bug. This species rolls into a ball when threatened, and is also commonly known as a roly-poly.

Both species are important in the study of soil ecology. But do they interact with one another? If so, how? One way to study this question is by looking to see if the two species are associated with one another in the wild. How often are they found together? If they are very frequently found together and rarely found alone, that suggests an association between the two organisms. When an association between two species is found in the wild, it indicates that there may be an ecological interaction between the two species. They may compete for the same resources, prey upon one another, or be engaged in some kind of symbiotic relationship. Though simply finding an association cannot tell us which of these is the case, the presence of an association suggests that there is something worthy of further study.

In this activity, you will learn how to collect data to determine if there is an association between two species and analyze that data using a statistical test called the chi-squared test. First, we’ll walk through an example of how to calculate the chi-squared test by evaluating the association between two plant species. Next, you’ll learn about how ecologists use statistical tests to determine if their data is significant. Finally, you’ll collect your own simulated data to determine if there is an association between pill bugs and springtails.

In this example we will test for the association between two plant species, bell heather (Erica cinerea) and ling (Calluna vulgaris). Both are commonly found in moorlands, which are high ground regions with acidic, low-nutrient soils. The question here is whether there is a statistically significant association between ling and bell heather on an area of moorland. Do the two species tend to occur together?

To find out, ecologist Angie O. Spermophyte visited 200 quadrats, positioned at random in a 100m2 area of moorland. In each quadrat, Angie recorded the presence or absence of each species, as shown in the table on the next page:

Table 1: Observed results of quadrat sampling on a 100 m2 moorland areaHeather present Heather absent Total

Ling present 89 45 134Ling absent 31 35 66

Total 120 80 200

a. How many quadrats did Angie find with bell heather and ling together? _________

b. How many quadrats did Angie find with bell heather only? __________

c. How many quadrats did Angie find with ling only? __________

At first glance, it seems to Angie like the two plants are most often found together. However, how do we know whether this finding is significant, or just due to chance? Angie certainly didn’t visit every moorland area in the world, and in fact she didn’t even visit every quadrat within the area that she marked off to study. Furthermore, some quadrats did contain each species alone. How does Angie know if there is enough evidence to claim that there is an association between these species?

Page 2: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species

1. Writing hypothesesScientists are naturally skeptical of new findings. Though it would be exciting to find a new association between the two species, in science we assume there is no relationship until proven otherwise. In statistics, this view is called the null hypothesis. The null hypothesis is the default position that there is no relationship between two measured phenomena. Scientists carry out statistical tests to determine if there is sufficient evidence to reject this view.

The null hypothesis in this example would be that there is no statistically significant association between bell heather and ling: that is, their distributions are independent of each other. If our results are statistically significant, then we can reject the null hypothesis and accept an alternative hypothesis – that there is an association between the two species. Notice the peculiarities of language here; we are not trying to prove our hypothesis, but instead we are seeing if there is enough evidence to reject the null hypothesis. Scientists are skeptical until proven otherwise by data.

Whenever we perform a statistical test, it is important to define the null hypothesis (H0) and an alternative hypothesis (H1). Write hypotheses for the study of bell heather and ling:

H0: ______________________________________________________________________

_________________________________________________________________________

H1: ______________________________________________________________________

_________________________________________________________________________

In the next two steps, we will work through an example of using the chi-squared test to determine if there is enough evidence to reject the null hypothesis.2. Calculating expected results assuming the null hypothesis is trueIf the null hypothesis were true, what results would we expect to obtain when quadrat sampling? The two species would be randomly distributed with respect to each other, so simple probability calculations can tell us how likely we would be to encounter each species in any given quadrat. For example, given the results in Table 1, we can find the probability of randomly encounter ling in one of our 200 quadrats:

Probability of LING∈any quadrat=¿of quadratswithlingtotal¿

of quadrats¿=134200

=0.67

Based on Angie’s results, if I stepped into any random quadrat in the moorland, I would have a 67% chance of encountering ling. Use the same reasoning to calculate the probability of encountering bell heather in a quadrat:

Probability of HEATHER∈any quadrat=¿

The probability of both species occurring together, assuming that the null hypothesis is true and they are randomly distributed, can be determined by multiplying the two probabilities together. Calculate it:

Probability of finding LING∧HEATHER together=¿

Our expected results should be given as a number of quadrats, not a probability. Based on the probability we found, if Angie visited 200 quadrats again, how many of those quadrats would contain both ling and heather? This can be found by multiplying the probability of finding them together by the total number of quadrats sampled:

Expected number of quadrats containing LING∧HEATHER=¿

Page 3: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species

Table 2 below will show the number of each type of quadrat we would expect to find if the species were randomly distributed (as suggested by the null hypothesis). In the last calculation, you should have found that 80 quadrats are expected to contain both heather and ling together. We can work out the other expected values by subtracting from the totals (If 120 quadrats contain heather, and 80 are expected to have both ling and heather, then how many contain heather alone?) Fill in these values:

Table 2: Expected results of quadrat sampling on a 100 m2 moorland areaHeather present Heather absent Total

Ling present 80 134

Ling absent 66

Total 120 80 200

The table above represents the “ideal” results if there were no association between the two species. Because the world is not ideal and there is some randomness involved in ecosystems, we would not always expect to find these results, even if the null hypothesis is in fact true. If we find 81 quadrats with the two species together rather than the expected 80, we wouldn’t automatically assume the results are significant. What about if there were 82, or 83 such quadrats? How different must our observed results be from the expected results for us to claim that the two species are associated?3. Calculating the chi-squared testA statistical test gives scientists a standardized metric for determining if their results are significant. The chi-squared test is one such test. It is calculated by the formula:

In the equation, o refers to our observed results (that is, the real data Angie collected) and e refers to the expected results. χ2 is the mathematical representation of “chi-squared” – it does not mean that you have to do any squaring of your results. To solve for chi-squared value, you need only to calculate the term on the right.

To organize our work, let’s collect the data from Table 1 and 2 into a single table. Fill in the table below:

Table 3: Calculating the chi-squared testHeather present Heather absent Total

Ling present O 89134

E 80Ling absent O

66E

Total 120 80 200

The equation above has a summation sign, Σ. This tells us we need to calculate the term on the right for each set of values we compare. Because there are four types of quadrat, we will need to calculate the term on the right in the chi-squared equation four times, and then add our results. The term for the quadrats with both heather and ling present has been done for you. Calculate the other terms and sum the final result below:

¿(89−80)2

80+ + +

χ 2 = __________ (keep three decimal places)

Page 4: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species

What is the purpose of all this math? One way of thinking about the chi-squared test is that it measures the difference between the results you observed and the results you’d expect if the null hypothesis were true. You can see that if there were no difference between observed and expected values, you would calculate a chi-squared value of zero. The larger the difference between your observed and expected values, the larger χ2 value you will get. Thus, the larger a χ2 value, the more drastically your results differed from the results we predicted when we were skeptically assuming the null hypothesis to be true. A large χ2 suggests that – hey! Maybe something interesting is going on here, and there really is an association between the species. But how large does χ2 need to be for us to claim an association?

4. Interpreting the results of a chi-squared testTo find whether a result is statistically significant or not, the calculated chi-squared value must be compared to a critical value. The critical value is the minimum chi-squared value needed for the results to be considered statistically significant. You look up a critical value in a table such as the one below:

You can see there are many critical values. To locate the relevant critical value for your experiment, you need to identify the appropriate row and column.

The rows are organized by degrees of freedom. For experiments that evaluate the association between two species, there is one degree of freedom.

The columns in the table are organized by the probability values (or p-values, for short). In statistics, the probability value is the probability of obtaining your observed results by chance if the null hypothesis were true. The smaller the p-value, the less likely it is that your results are due to random chance alone.A probability value of .05 means that there would be a 5% of chance of obtaining your results by chance if the null hypothesis were true. This value is often used as a minimum threshold for significance.

Look in the appropriate row and column and find the critical value listed there: ________________

If your calculated chi-squared value is greater than the critical value, you can reject the null hypothesis. If the chi-squared value is less than the critical value, do not reject the null hypothesis.

Is there an association between bell heather and ling? How do you know?

____________________________________________________________________________________

____________________________________________________________________________________

χ2 < CV, Do not reject null hypothesis χ2 > CV, Reject null hypothesis

Page 5: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species
Page 6: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species

Quadrat AND Chi-Squared Test Activity

Calculate the chi-squared test. You will need to do the following:Using the graphic organizer on the next page:

State the hypothesis and null hypothesis. Collect data:

i. To simulate quadrat sampling you will get two bags, one with numbered cards and the other with lettered cards.

ii. For each quadrat sample you will select one numbered card and one lettered card. iii. Using those cards, find the quadrat where the number and letter intersect.

1. Are both species present? Neither? Only one or the other?iv. Draw a tally mark in the appropriate cell of your contingency table (next page).v. Put cards back in designated bags.

vi. Repeat ii-iv for a total of 20 quadrat samples.vii. Add tally marks for each cell then fill in total columns and rows.

Calculate the expected values, showing your calculations, then add to contingency table Calculate the chi-squared test, showing your calculation. State the probability value and degrees of freedom you are using. State the critical value. State whether the null hypothesis is rejected or not.

Figure 1: Anatomy of a pill bug Figure 2: Anatomy of a springtail

Use the graphic organizer to create a rough draft of your work.

Page 7: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species

Chi-squared Graphic Organizer1. Write hypotheses:

H0: ______________________________________________________________________

_________________________________________________________________________

H1: ______________________________________________________________________

_________________________________________________________________________

2. Calculate the chi-squared testa. Fill in the table below:

Pill Bug present

Pill Bug absent Total

Springtail present

OE

Springtail absent

OE

Total

b. Show your work to calculate chi-squared

3. Calculate the expected values if the null hypotheses were true:

a. Calculate the probability of finding both species together.

b. Calculate the probability of finding the remaining probabilities (subtraction from total).

4. Determine the critical value. ____________5. Interpret your results

Calculated χ2 = ___________ > or < Critical value

Therefore, we (reject / do not reject) the null hypothesis, and there (is / is not) an association.

Page 8: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species
Page 9: Chi-Squared Test Activity - magistra houshangi Web viewChi-Squared Test Activity. ... Table 2 below will show the number of each type of quadrat we would expect to find if the species