Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chi-squared Testing for a difference. What does it do? Compares numbers of people/plants/species… in different categories (eg different pollution levels,

Similar presentations


Presentation on theme: "Chi-squared Testing for a difference. What does it do? Compares numbers of people/plants/species… in different categories (eg different pollution levels,"— Presentation transcript:

1 Chi-squared Testing for a difference

2 What does it do? Compares numbers of people/plants/species… in different categories (eg different pollution levels, sheltered/unsheltered shore…) Looks for a difference between categories (eg differences in numbers of species in 3 locations) Compare any number of different categories

3 Planning to use it? You really want to just test for difference. It will not pick up correlation You are working with numbers of things, not, eg area, weight, length, %… You have an average of at least 5 things (plants/species…) in each category Make sure that…

4 How does it work? You assume (null hypothesis) there is no difference between categories It compares  observed values the data you collected  expected values what you’d get if there was really no difference

5 Doing the test These are the stages in doing the test: 1.Write down your hypotheseshypotheses 2.Work out the expected valuesexpected values 3.Use the chi-squared formula to get a chi- squared valuechi-squared formula 4.Work out your degrees of freedomdegrees of freedom 5.Look at the tablestables 6.Make a decisiondecision Click here Click here for an example

6 Hypotheses H 0: There is no difference between the categories H 1: There is a difference between the categories

7 Expected Values We assume (null hypothesis) that there’s no difference So the expected values are the average of the data you’ve got Just add your data up, then divide by the number of categories

8 Chi-Squared Formula For each category, work out O = Observed value – your data E = Expected value – which you’ve calculated Then add all your values up. This gives the chi-squared value  = “Sum of”

9 Degrees of freedom The formula here for degrees of freedom is degrees of freedom = n – 1 Where n is the number of categories You do not need to worry about what this means –just make sure you know the formula! But in case you’re interested – the more categories you have, the more likely you are to get a “strange” result in one or more of them. The degrees of freedom is a way of allowing for this in the test.

10 Tables This is a chi-squared table These are your degrees of freedom (df) These are your significance levels eg 0.05 = 5%

11 Make a decision If the value you calculated is bigger than the tables, you reject your null hypothesis – so there is a difference If the value you calculated is smaller than the tables, you accept your null hypothesis – so there is no significant difference.

12 Example: Air Pollution & Asthma 50 randomly selected sixth formers at three different sixth form colleges are asked whether they suffer from asthma. The colleges are located in a large city, a medium sized town and a rural location. Hypotheses: H 0: There is no difference in incidence of asthma H 1 There is a difference in the incidence of asthma

13 The data Numbers of students with asthma: CityTownRural 20 7 18

14 The calculations Expected value for each citytownrural Obs20 7 18 Exp151515 (O – E)5-8 3 (O – E) 2 2564 9 (O – E) 2 /E1.66674.26670.6

15 The test  2 = 6.5333 Degrees of freedom = 3 – 1 = 2 Critical value (5%) = 5.991 So we reject H 0 – there is a difference in incidence of asthma between city, town and rural


Download ppt "Chi-squared Testing for a difference. What does it do? Compares numbers of people/plants/species… in different categories (eg different pollution levels,"

Similar presentations


Ads by Google