CHI SQUARED TEST
USING 2004 FIELDWORK DATA
2 uses for this statistical test: one of these is a test of ASSOCIATION between 2 sets of data - the idea is to test whether we can accept or reject a NULL HYPOTHESIS: that there is no association between the 2 sets of data.
Figures are totals (based on a maximum reading of 100 from 10 x 10 point quadrat readings...)
| Plant Species | Low Marsh | High Marsh | ||||||||||
| Samphire (Sallicornia) | 84 | 38 | 62 | 51 | 86 | 30 | 62 | 52 | 20 | 44 | 55 | 12 |
| Sea Lavender | 3 | 0 | 0 | 0 | 0 | 0 | 35 | 38 | 36 | 28 | 45 | 37 |
| Cord Grass | 44 | 17 | 5 | 6 | 52 | 89 | 15 | 8 | 7 | 0 | 0 | 0 |
| Sea Purslane | 2 | 0 | 0 | 0 | 0 | 0 | 40 | 19 | 37 | 2 | 48 | 39 |
| Sea Arrowgrass | 0 | 0 | 0 | 0 | 0 | 0 | 57 | 33 | 6 | 57 | 16 | 0 |
| Sea Aster | 13 | 31 | 7 | 21 | 19 | 78 | 11 | 16 | 3 | 14 | 13 | 0 |
| Annual Seablite | 44 | 55 | 20 | 15 | 4 | 55 | 13 | 27 | 16 | 0 | 0 | 0 |
| Salt Marsh Grass | 1 | 0 | 0 | 0 | 0 | 0 | 76 | 46 | 24 | 94 | 62 | 52 |
| Sea Plantain | 0 | 0 | 0 | 0 | 0 | 0 | 9 | 43 | 5 | 0 | 0 | 0 |
| Sea Couch Grass | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 10 | 0 | 0 | 0 | 0 |
| Scurvy Grass | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
| Sea Rush | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 | 0 | 0 | 0 | 0 |
A look at one or two INDICATOR SPECIES on different parts of the marsh could help.
You can start with SALICORNIA or SAMPHIRE: want a picture of this plant ? There's one on the coastal fieldwork page, or you can take your own, or you can do a search on the Internet, where you'll find some very nice ones.
First of all get the data. I asked my students to tell me how many of their 60 observations of Samphire fitted into one of 3 categories (remember that you need to have at least 5 observations in each category and fortunately I set my class boundaries far enough apart...)
Set a NULL HYPOTHESIS (H0)
Need to work this into a table so that OBSERVED and EXPECTED VALUES can be worked out. There were 60 observations in total at both locations.
The statistics need to be put into a table and here we need an equation to work out the expected values in a cell.
Need to work out totals
| Samphire | 0-3 | 4-6 | 7-10 | Total |
| Low Marsh (O) | 14 | 19 | 27 | 60 |
| High Marsh (O) | 22 | 25 | 13 | 60 |
| Totals | 36 | 44 | 40 | 120 |
Formula below:
Expected frequency for cell = column total x row total divided by the grand total.
| Samphire | 0-3 | 4-6 | 7-10 | Total |
| Low Marsh (O) | 14 | 19 | 27 | 60 |
| Low (E) | 18 | 22 | 20 | |
| High Marsh (O) | 22 | 25 | 13 | 60 |
| High (E) | 18 | 22 | 20 | |
| Totals | 36 | 44 | 40 | 120 |
Then apply the usual Chi Squared formula to each of the Observed / Expected Values
So this would be (for the grey cells)
14-18 squared over 18 = 0.89
Do the same or all 6 cells in table and add them up to give the chi squared value. This then needs to be looked up on the tables. This time, we have a formula for working out the degrees of freedom (because we are using a table....)
degrees of freedom = (number of rows-1) X (number of columns -1)
= 2 (2 x 1)
Chi squared value = 7.5
Look at the tabulated values.
| Degrees of Freedom | Significance level | ||||
| .10 | .05 | .25 | .01 | .005 | |
| 1 | 2.71 | 3.84 | 5.02 | 6.63 | 7.88 |
| 2 | 4.61 | 5.99 | 7.38 | 9.21 | 10.60 |
| 3 | 6.25 | 7.81 | 9.35 | 11.34 | 12.84 |
| 4 | 7.78 | 9.49 | 11.14 | 13.23 | 14.86 |
Look at 2 degrees of freedom. Check the 95% probability first (.05).
Chi squared value is 7.5
Tabulated value (2 d.o.f) = 5.99
This is bigger, so we can REJECT the NULL Hypothesis.
It is also higher than the 0.25 line, so we have even more certainty that the pattern we have seen is not down to chance: THERE IS A DIFFERENCE BETWEEN THE LOWER MARSH and THE HIGHER MARSH IN THE AMOUNT OF SALICORNIA.