Download presentation
Presentation is loading. Please wait.
Published byKristopher Byrd Modified over 8 years ago
1
Chi-squared Goodness of fit
2
What does it do? Tests whether data you’ve collected are in line with national or regional statistics. Are there similar numbers of hot and cold days in town X as in the region generally? Are the frequencies with which local households recycle in line with national statistics? NB: Do NOT use this test to compare, for example, two towns. Chi-squared Association is the test for that.
3
Planning to use it? You are working with numbers of people/ things, not, eg area, weight, length, %… You have an average of at least 5 people/things in each category You have some national/regional/global data to compare your data to. Make sure that…
4
How does it work? You assume (null hypothesis) that local figures are in accordance with national figures It compares observed values the data you collected expected values what you’d get if the local data really did match the national data
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: Data collected is in accordance with national/regional data H 1: Data collected is not in accordance with national/regional data Be specific about what the data are you are collecting, and the data you are comparing it to!
7
Expected Values Use your national data to work out the percentage of people/things in each category. Find the total number of people/things in your sample. Work out the numbers you’d expect in each category by doing:
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 your figures do not fit national data/ predictions If the value you calculated is smaller than the tables, you accept your null hypothesis – so your figures do fit national data/predictions.
12
Example: Comparing Birmingham weather to the West Midlands overall A student decided to investigate whether Birmingham had comparable numbers of hot and cold days to the West Midlands in general. Hypotheses: H 0 : The number of hot and cold days in Birmingham is in accordance with the West Midlands generally H 1 : The number of hot and cold days in Birmingham is not in accordance with the West Midlands generally
13
The Data Obtained Between 01/09/2002 and 31/08/2003, in Birmingham there were: 16 hot days (mean temperature > 20 o C) 11 cold days (mean temperature < 0 o C) 338 neither hot nor cold days
14
The West Midlands Data Over the ten-year period 1993-2002, percentages of hot and cold days in the West Midlands were: 2.47% hot days 2.37% cold days 95.16% neither hot nor cold days
15
Finding Expected Values Use the regional % figures to find the expected values: Find the total number of days Work out the expected number of days in each category using: Expected number
16
The Expected Values Total number of days = 365 Expected Values Category Expected Hot 2.47 365 100 = 9.02 Cold 2.37 365 100 = 8.65 Neither95.16 365 100 = 347.33
17
The calculations: (O-E) 2 /E Category O E(O – E) 2 /E Hot 16 9.025.401 Cold 11 8.650.638 Neither338347.330.251
18
The test 2 = 5.401 + 0.638 + 0.251 2 = 6.290 Degrees of freedom = 3 – 1 = 2 Critical value (5%) = 5.991 So we reject H 0 – the number of hot and cold days in Birmingham is not in accordance with the West Midlands generally.
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.