Goodness of Fit (Edexcel A Level Further Maths: Further Statistics 1): Revision Note

Exam code: 9FM0

Dan Finlay

Written by: Dan Finlay

Reviewed by: Lucy Kirkham

Updated on

Goodness of fit

What is the difference between observed values and expected values?

  • Goodness of fit is a measure of how well real-life observed data fits a theoretical model

    • For example, modelling a coin as fair then flipping it 20 times  

      • You may observe 13 heads

      • You would expect 10 heads

  • Observed (Oi) and expected (Ei) values can be shown in a table

    • For example, rolling a fair die 60 times (N=60)

      Outcome

      1

      2

      3

      4

      5

      6

      Oi

      12

      7

      8

      10

      14

      9

      Ei

      10

      10

      10

      10

      10

      10

      • Note that sum from blank to blank of O subscript i equals sum from blank to blank of E subscript i equals N equals 60

  • How different do observed and expected values need to be before the model is not a good fit

    • You can do a hypothesis test to reach a conclusion

What are the null and alternative hypotheses?

  • H0: There is no difference between the observed and the expected distribution

  • H1: The observed distribution cannot be modelled by the expected distribution

  • Let α% be the significance level

How do I calculate the goodness of fit?

  • First, combine any columns for which expected values are less than 5 until they are greater than 5

    • For example

      Score

      1

      2

      3

      4

      Oi

      15

      6

      4

      1

      Ei

      12

      8

      4

      2

      • The expected value of 2 is less than 5 so combine the last two columns

      Score

      1

      2

      3+

      Oi

      15

      6

      5

      Ei

      12

      8

      6

  • Then calculate the goodness of fit, X2, from the formula

    • X squared equals sum from blank to blank of open parentheses O subscript i minus E subscript i close parentheses squared over E subscript i

  • An alternative version of the formula that can be easier to calculate is

    • X squared equals sum from blank to blank of O subscript i squared over E subscript i minus N

      • Where N is the sum of all observed values

      • N equals sum from blank to blank of O subscript i

      • This is also the same as the sum of all expected values

  • The larger X2 is, the more different the observed values are from the expected values

What are degrees of freedom?

  • The number of degrees of freedom, ν, is equal to

    • The number of columns (after combining to get Ei>5) subtract 1

  • If you also use the observed data to estimate a parameter, then you subtract 2 instead

    • For example, trying to estimate p when comparing to a B(n,p) distribution

  • You are subtracting the number of constraints (or restrictions)

    • This is the number of times you use the observed data to help form the expected data

      • This is always 1 from ensuring their totals match, sum from blank to blank of E subscript i equals sum from blank to blank of O subscript i

      • Then another 1 for each parameter estimated

How do I use the chi-squared distribution?

  • Once you have calculated the goodness of fitX2

    • Compare it to the critical value χν2 from the chi-squared distribution

      • ν is the number of degrees of freedom

      • Tables of critical values are provided in the exam

      • You need the significance levelα%

      • All chi-squared tests are one-tailed

    • If X2<χν2 (α%) then there is insufficient evidence to reject H0

      • This means there is no difference between the observed and expected distributions

      • In other words, "the expected distribution is a suitable model for the data"

    • If X2>χν2 (α%) then there is sufficient evidence to reject H0

      • The expected distribution is not a suitable model for the data

  • Alternatively, you can use your calculator to find the χν2 p-value

    • This is the probability of obtaining a chi-squared value of X2 or more

    • If p<α then the result is critical (reject H0)

Examiner Tips and Tricks

  • The alternative formula X squared equals sum from blank to blank of O subscript i squared over E subscript i minus N is not given in the Formulae Booklet

Worked Example

A game is meant to award points according to the probability distribution below.

Points

2

4

8

10

Probability

0.6

0.2

0.15

0.05

The game is played by 40 people, giving the results below.

Points

2

4

8

10

Frequency

28

5

4

3

Test, at the 5% level of significance, whether or not the game is operating correctly.

goodness-of-fit-1
goodness-of-fit-2

Unlock more, it's free!

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Build on this topic

Dan Finlay

Author: Dan Finlay

Expertise: Portfolio Lead

Dan graduated from the University of Oxford with a First class degree in mathematics. As well as teaching maths for over 8 years, Dan has marked a range of exams for Edexcel, tutored students and taught A Level Accounting. Dan has a keen interest in statistics and probability and their real-life applications.

Lucy Kirkham

Reviewer: Lucy Kirkham

Expertise: Content Creator

Lucy has been a passionate Maths teacher for over 12 years, teaching maths across the UK and abroad helping to engage, interest and develop confidence in the subject at all levels.Working as a Head of Department and then Director of Maths, Lucy has advised schools and academy trusts in both Scotland and the East Midlands, where her role was to support and coach teachers to improve Maths teaching for all.