Coding Data (Edexcel International AS Maths: Statistics 1): Revision Note

Exam code: XMA01

Amber

Written by: Amber

Reviewed by: Dan Finlay

Updated on

Coding data

Sometimes data needs to be coded for further use with calculations. This is particularly useful with data that deals with very small or very large numbers, or with data that needs to be classified for research purposes.

What is coding?

  • Coding is a way of simplifying data to make it easier to work with

  • The coding must be carried out on all values within the data set and will normally be done using a given formula

  • Coding can be carried out in a number of ways:

    • Adding or subtracting a constant to each data value

    • Multiplying or dividing each data value by a constant

    • A combination of both of the above

How are statistical calculations carried out with coded data?

  • If you know the mean or standard deviation of the original data it is possible to find the mean or standard deviation of the coded data and vice versa

  • It is important to remember what the mean and standard deviation actually tell us about the data to understand how coding calculations work

    • The mean is a measure of location, changing the data set in any way will cause the mean to change in the same way

    • The standard deviation is a measure of spread, adding or subtracting a constant to every value within the data set will not change the standard deviation of the data set

      • Multiplying or dividing every value within the data set by a constant will change the standard deviation by the modulus of the constant

      • If the data were coded by multiplying or dividing by a negative, the standard deviation will change by the equivalent positive value

  • Anytime calculations are carried out on data that has been coded,

    • The original mean can be found by solving the equation to reverse the coding

    • For example, if the data, x, was coded using the formula

y=ax+b

Then the mean of the coded data, y¯ would be   

y¯=ax¯+b

The original mean, x¯ , will be  x¯ =y¯ ba

  • The original standard deviation

    • Will be the same as the coded standard deviation if the data was coded by adding or subtracting a constant only

    • Can be found by reversing the coding if the data was coded by multiplying or dividing by a constant only

    • If the data was coded by a combination of both then only the multiplying or dividing will need to be reversed to find the original standard deviation

    • For example, if the data, was coded using the formula

y = ax+b

Then the standard deviation of the coded data, σywould be

σy=|a|σx

The original standard deviation, σx, will be

σx=σy|a|

Worked Example

The shoulder height, h, of a group of Asian elephants living in a nature reserve are summarised in the table below.

Height, cm

Frequency, f

 200  h < 220

2

 220  h < 240

5

 240  h < 260

8

 260  h < 280

8

 280  h < 300

5

 300  h < 320

2

(i) Code the data using the formula x = h25020

 

(ii) Use the coded data to find an estimate for the mean and standard deviation, you may use the summary statistics Σxf = 15, Σx2f = 59, Σ f=30.

Answer:

2-1-4-coding-we-solution-part-1
2-1-4-coding-we-solution-part-2

Examiner Tips and Tricks

  • Be careful when using the formulae for the mean and standard deviation with coded summary statistics, you must make sure that you use the summary statistics consistently throughout. For example, if you use the sum of the coded data squared in the formula for the standard deviation, you must subtract the square of the coded mean.

Unlock more, it's free!

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

the (exam) results speak for themselves:

Build on this topic

Amber

Author: Amber

Expertise: Maths Content Creator

Amber gained a first class degree in Mathematics & Meteorology from the University of Reading before training to become a teacher. She is passionate about teaching, having spent 8 years teaching GCSE and A Level Mathematics both in the UK and internationally. Amber loves creating bright and informative resources to help students reach their potential.

Dan Finlay

Reviewer: 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.