Lecture 9

Transformation and comparisons

Introduction to standardisation and z scores



Dr Lincoln Colling

21 Nov 2022


Psychology as a Science

Outline for today

  • The standard normal distribution

  • Transformations

    • Centering

    • Scaling

    • The z-transform

  • Making comparisons

    • Comparing groups

    • Comparing across groups

    • Making comparisons with the sampling distribution

The shape of things

  • If we measured the height of 1000 women and plotted the values then we might get something like Figure 1.

  • Most heights are in the 155–175 centimetre range.

  • The distribution is roughly symmetrical around its mean (165 cm) and it has a shape characteristic of a normal distribution.

Figure 1: Distribution of heights in a sample of 1000 women. Not real data.

The shape of things

  • Of course the plot in Figure 1 doesn’t look exactly like a normal distribution

  • But if we measured more and more people (e.g., 100, 000 people) then we might get something like Figure 2

  • Figure 2 also shows the corresponding normal distribution with a mean of 165 and a standard deviation of 10

  • Although the normal distribution is an idealisation, or an abstraction, we can use it to do some very useful things

Figure 2: Distribution of heights in a sample of 100,000 women (Not real data) and the corresponding normal distribution

The standard normal distribution

  • In lecture 8, I said that two parameters, \(\mu\) and \(\sigma\) changed where the normal distribution was centred and how spread out it was

  • When \(\mu = 0\) and \(\sigma = 1\), then this distribution is called the standard normal distribution

  • I said that changing these values didn’t change the relative position of points on the plot. The overall shape remains the same

  • All normal distributions have the same overall shape as the standard normal distribution even if they’re centered in a different place and are more or less spread out

To see what I mean by this, we’ll take out heights of 1000 people, but instead of displaying them in centimetres we’ll display them in metres

(a) Measured in centimetres

(b) Measured in metres

Figure 3: Distribution of heights in a sample of 1000 women. Not real data.

Changing the scale on which you’re measured doesn’t actually change your height relative to other people

  • The distribution in Figure 3 (a) has a standard deviation of 10

  • The distribution in Figure 3 (b) has a standard deviation of 0.1.

But as you can see, they’re the same distributions—they’re just displayed on different scales (centimetres versus metres).


Changing the scale changes the standard deviation. This is why the standard deviation is sometimes referred to as the scale parameter for the distribution.

  • Apart from changing the scale, we can also change where the distribution is centred

(a) Measured in centimetres

(b) Measured in difference from the average height

Figure 4: Distribution of heights in a sample of 1000 women. Not real data.

  • In Figure 4 (a) we can see the same distribution as before. In Figure 4 (b) we can see a distribution that is now centred at 0.

The normal distribution

  • The fact that the relative positions of points don’t change is a useful property.

  • For the standard normal distribution, ~68% of the distribution falls between -1 and +1.

  • Put into relative terms this is ±1 \(\sigma\) from \(\mu\).

Transformations

  • In Figure 3 and Figure 4 we saw that we could transform a variable so that it had a new location (mean) or scale (standard deviation) without changing the shape

  • These two kinds of transformations are known as centering and **scaling*

Centering

  • To centre a set of measurements, you subtract a fixed value from each observation in the dataset.

  • This has the effect of shifting the distribution of the variable along the x-axis

  • You can technically centre a variable by subtracting any value from it but the most frequently used method is mean-centring

This is shown in Equation 1, below:

\[x_i - \bar{x} \qquad(1)\]

Mean centering

  • Mean centering a variable shifts it so that the new mean is at the zero point

  • The individual values of a mean-centred variable tell us how far that observation is from the mean of the entire set of measures

  • It doesn’t alter the shape of the distribution, or change the scale that it’s measured on

  • It only changes the interpretation of the values to, for example, differences from the mean

Scaling

  • Scaling is performed by dividing each observation by some fixed value

  • This has the effect of stretching or compressing the variable along the x-axis

  • You can scale a variable by dividing it by any value

  • But typically scaling is done by dividing values by the standard deviation of the dataset.

This is shown in Equation 2, below:

\[\frac{x_i}{s} \qquad(2)\]

  • Scaling doesn’t change the fundamental shape of the variable’s distribution

  • But after scaling the data by the standard deviation the values would now be measured in units of sd

The z transform

  • The combination of first mean-centering a variable and then scaling it by its standard deviation is known as the z-transform

The formula for this is shown in Equation 3, below:

\[z(x) = \frac{x_i - \bar{x}}{s} \qquad(3)\]

The z transform

  • The 10 values in Table 1 have a mean of 5.7 and a standard deviation of 2.21.

  • To ztransform the data in Table 1. We would do the following steps:

  1. We’d subtract 5.7 from each value and put them in the Centred column

  2. Then we’d divide each value in Centred by 2.21

  • We can now interpret the data in terms of distance from the mean in units of standard deviation

The z transform will come in handy when it comes to making comparisons

Table 1: z transformed data
Raw values Centred Scaled
4 -1.7 -0.77
6 0.3 0.14
6 0.3 0.14
9 3.3 1.49
1 -4.7 -2.12
7 1.3 0.59
5 -0.7 -0.32
8 2.3 1.04
5 -0.7 -0.32
6 0.3 0.14

Comparing groups

In the context of quantitative research we’re often looking at the average difference in a variable between groups

In the Figure 5 we can see measurements from a reaction time task.

  • Amateurs sportspeople have a mean reaction time of 500 ms and professionals have a mean reaction time of 460 ms.

  • There is overlap between the two groups, but there is a difference between the averages

  • To quantify the difference, just subtract the mean of one group from the mean of the other1

Figure 5: Distribution of reaction times in a sample of amateur (green) and 500 professional (blue) sportspeople. Group means are indicated with the vertical lines.

  • The mean difference is just 500ms - 460ms = 40ms.

Comparing across groups

  • In the previous example the comparisons were easy because the measurements were on the same scale (milliseconds)

  • But let’s say that you want to compare two children on a puzzle completion task

    • One child is 8 years old, and the other is 14 years old

    • They do slightly different versions of the task and the tasks are score differently

  • Because we have two different tests that might have a different number of items etc we can’t just compare the raw numbers to see which is bigger

Let’s look at an example…

Comparing across groups

Let’s take two children:

  • Ahorangi is 8 years old and scored 86 on the task

  • Benjamin is 14 years old and scored 124 on the task

We can easily tell that Benjamin’s score is higher than Ahorangi’s score

But the scores are not directly comparable…so what do we do?

  • We have to look at how each performed relative to their age groups.

  • Is Ahorangi better performing relative to 8-year-olds than Benjamin is relative to 14-year-olds?

  • To answer this question we can use the z-transform

Comparing across groups

To do the z-transform we need to know the mean and standard deviation for each age group

Table 2: Means and Standard deviations for the 8-year-old and 14-year-old age groups
Age group Mean Standard deviation
8-year-olds 80 2
14-year-olds 120 8

We can calculate Ahorangi’s z-score as follows:

\[3 = \frac{86 - 80}{2}\]

And for Benjamin:

\[0.5 = \frac{124 - 120}{8}\]

That means, that Ahorangi, despite having a lower score, actually scored very high for an 8-year-old. Benjamin, on the other hand, only scored a little higher than the average 14-year-old.

Making comparisons with the sampling distribution

The final comparison we’ll talk about is comparisons against the sampling distribution

  • From last week we learned that the sampling distribution of the mean will be

    • Centred at the population mean

    • Have a standard deviation equal to the standard error of the mean

  • But remember, we don’t know the value of the population mean, so we won’t actually know what the sampling distribution looks like

Although we don’t know the value of the population mean we can generate a hypothesis about what we think the population mean might be…

We can then generate a hypothetical sampling distribution based on our hypothesised value of the population mean

Making comparisons with the sampling distribution

I’ll make it concrete with an example:

  • Let’s say I get a group of people to perform a task where they have to try and quickly recognise two sets of faces. Either famous faces or faces of their family members.

  • I find that the mean difference between these two conditions is 24.87ms

  • But this is just the difference in my sample. The population mean difference might be some other value

  • Although we don’t know the population mean, we could hypothesise that it is 100 ms, 50 ms, 0 ms, or some other value. Let’s just pick 0 ms for now.

  • Now we can generate a sampling distribution using our hypothesised population mean and the standard error of the mean we estimate from the sample (let’s say it’s 8.88)

Making comparisons with the sampling distribution

In Figure 6 we can see what the sampling distribution would look like if the population mean were 0.

  • We can compare our particular sample mean of 24.87ms to the sampling distribution

  • Because the sampling distribution is a normal distribution we know that ~68% of the time the sample means will fall between ±1 SEM of the population mean (-8.88ms to 8.88ms)

  • And ~95% of the time sample means will fall between -17.76ms and 17.76ms.

Figure 6: The sampling distribution with a mean of 0 and a SEM of 8.88

For our particular mean we see that it falls 2.8 SEM from our hypothesised population mean

What can we make of this?

Making comparisons with the sampling distribution

  • We can conclude that if the population mean were in fact 0 then we have observed something rare

  • If the population mean were in fact 0, then it would be rare for a sample mean to be that far away from the population mean

Observing something rare doesn’t tell us that our hypothesis is wrong

Rare things happen all the time!

  • But if we were to run our experiments again and again, and we continued to observe rare events then we would probably have a good reason to update our hypothesis.

This process of comparing our sample to the sampling distribution is known as null hypothesis significance testing

And it will be a major topic that you’ll cover next year.