Sophisticated data analysis will help you spot patterns, trends and relationships in your results. Data analysis can be qualitative and/or quantitative, and may include statistical tests. An example of a statistical test is outlined below.

## Chi-squared test

Chi squared in a statistical test that is used either to test whether there is a significant difference, goodness of fit or an association between observed and expected values.

$$\chi^2 = ∑\frac{(O-E)^2}{E}$$

The chi squared test can only be used if

• the data are in the form of frequencies in a number of categories (i.e. nominal data).
• there are more than 20 observations in total
• the observations are independent: one observation does not affect another

There are 3 steps to take when using the chi squared test

### Step 1. State the null hypothesis

There is no significant association between _______ and _______

### Step 2. Calculate the chi squared statistic

$$\chi^2 = ∑\frac{(O-E)^2}{E}$$

$$\chi^2$$ = chi squared statistic

$$O$$ = Observed values

$$E$$ = Expected values

### Step 3. Test the significance of the result

Compare your calculated value of $$chi^2$$ against the critical value for $$chi^2$$ at a confidence level of 95% / significance value of P = 0.05, and appropriate degrees of freedom.

$$\mathsf{Degrees\;of\;freedom = (number\;of\;rows\;– 1) \times (number\;of\;columns\;– 1)}$$

If Chi Squared is equal to or greater than the critical value REJECT the null hypothesis. There is a SIGNIFICANT difference between the observed and expected values.

If Chi Squared is less than the critical value, ACCEPT the null hypothesis. There is NO SIGNIFICANT difference between the observed and expected values.

### Worked example

A Geography student is investigating whether people’s previous experience of coastal floods has affected their preparedness for future floods. She surveyed householders in a coastal town, taking a stratified sample from householders that were flooded in winter 2013/4 and householders that were not flooded. One of the questions she asked was

Here are the results. Geographers call them the Observed Values.

Strongly agree5813
Agree71623
Neither5510
Disagree6511
Strongly disagree213
SUM253560

### Step 1. State the null hypothesis

There is no significant association between past experience of flooding and preparedness for floods in the future.

### Step 2. Calculate the chi squared statistic

It is best to break this down into a number of smaller steps.

(a) Calculate the Expected Values using the formula

$$\mathsf{Degrees\;of\;freedom = (number\;of\;rows\;– 1) \times (number\;of\;columns\;– 1)}$$
OEOE
Strongly agree55.487.6
Agree79.61613.4
Neither54.255.8
Disagree64.656.4
Strongly disagree21.311.8

(b) Calculate $$(O-E)$$ and $$(O-E)^2$$and $$(O-E)^2/E$$

Observed ($$O$$) and Expected ($$E$$) values have been copied from the table above.

Flooded
$$O$$$$E$$$$(O-E)$$$$(O-E)^2$$$$(O-E)^2/E$$
55.4-0.40.160.03
79.6-2.66.760.70
54.20.80.641.15
64.61.41.960.43
21.30.70.490.38
Not flooded
$$O$$$$E$$$$(O-E)$$$$(O-E)^2$$$$(O-E)^2//E$$
87.60.40.160.02
1613.42.66.760.50
55.8-0.80.640.11
56.4-1.41.960.31
11.8-0.80.640.36

(c) Find the sum of the $$(O-E)^2/E$$ column

$$\chi^2 = ∑ \frac{(O-E)^2}{E}$$ $$\chi^2 = 0.03+0.70+1.15+0.43+0.38+0.02+0.50+0.11+0.31+0.36$$ $$chi^2 = 3.99$$

### Step 3. Test the significance of the result

Calculate degrees of freedom

$$\mathsf{Degrees\;of\;freedom = (number\;of\;rows\;– 1) \times (number\;of\;columns\;– 1)}$$

In this example $$\mathsf{Degrees\;of\;freedom} = (5-1) \times (2-1) = 4$$

Choose a significance level, e.g. $$p=0.05$$. This means that chance should only account for the results in up to 5% of occasions the field test is carried out.

Compare the result with the critical value in the table. If the calculated value is greater than the critical value in the table the null hypothesis must be rejected.

At 3 degrees of freedom at $$p=0.05$$, the critical value is $$9.49$$

Since our calculated value of $$3.99 > 9.49$$, the null hypothesis is not rejected.

There is no significant association between past experience of flooding and preparedness for floods in the future.

## Secondary and Further Education Courses

Set your students up for success with our secondary school trips and courses. Offering excellent first hand experiences for your students, all linked to the curriculum.