Skip to main content

Exercise 1

The aim of this exercise is to develop your understanding of the use of the terms introduced in 3.1 and the topics covered in 8.2. This example relates to the interactive exercise 1 in Chapter 7 and Example W7.1.

Example W7.1: The effect on reaction times of moderate alcohol intake in a cohort of 19 - 25 year olds.

An undergraduate investigated the effects on reactions to visual stimuli before and after moderate alcohol intake (three units consumed over a two hour period) in 16 healthy volunteers aged between 19 - 25 years. Activity and food intake was regulated before and during the test. We reported some of the data from this study in the interactive exercise 1 in chapter 7, but repeat it here as you will need to examine both tables of data to answer the first question.

As part of the investigation the mean rate of reaction (ms) to the visual stimuli (Table W7.1) and the number of errors made in response to the visual stimuli (Table W8.1) were recorded before and after the consumption of the alcohol. The undergraduate tested two pairs of hypotheses:

- that there is no difference in the mean rate of reaction (ms) to the visual stimuli before and after drinking moderate amounts of alcohol (Table W7.1)

- that there is no difference in the number of errors made in response to the visual stimuli before and after drinking a moderate amount of alcohol (Table W8.1).

Table W7.1: Mean response time (ms) to visual stimuli before and after consuming three units of alcohol over a two hour period in a cohort of 16 volunteers between ages 19 - 25 years

Volunteer

Mean response times (ms) before consumption of alcohol

Mean response times (ms) after consumption of alcohol

1

486.38330

489.08333

2

388.73330

362.70000

3

496.08333

553.66667

4

443.41667

446.63333

5

479.05000

626.06670

6

571.56660

546.21667

7

447.78333

477.63333

8

475.48333

469.15000

9

600.66667

476.50000

10

440.50000

544.23333

11

394.11667

495.23333

12

544.08333

470.36667

13

454.81667

515.06667

14

456.08333

501.40000

15

494.41667

431.11667

16

502.6500

510.66667



Table W8.1. Number of errors made in response to visual stimuli by volunteers before and after drinking a moderate amount of alcohol.

Volunteer

Number of errors made before alcohol intake

Number of errors made after intake of alcohol

1

5

3

2

2

3

3

4

3

4

2

3

5

1

1

6

3

4

7

3

3

8

3

1

9

5

4

10

2

2

11

7

13

12

2

4

13

2

1

14

0

2

15

1

0

16

2

1



1

Q W1.1

Using the terms introduced in Chapter 3 (3.1), and this table describe these two scales of measurement by putting a cross (x) in the boxes that are correct. Have you completed the table?

a) Yes
b) No
 

Mean response times (ms)

(Table W7.1)

Number of errors

(Table W8.1)

Qualitative

   

Quantitative

x

x

Discrete

 

x

Continuous

x

 

Rankable

x

x

Nominal

   

Ordinal

 

x

Interval

x

 


Complete the table before proceeding!
Check your answer

2

Q W1.2

One of these sets of observations is best analysed using a non-parametric test. Which one?

[If you would like to save a record of your answer, please type it into this Word document instead of the text box below]

The data from Table W8.1 are measured on an ordinal scale as they are 'numbers of' or 'counts'. These are non-parametric data and are best analysed using a non-parametric statistical test. The data from Table W7.1 are measured on an interval scale and may be parametric. You check this as part of the interactive exercise 1 in chapter 7. Check your answer

3

Q W1.3

A Wilcoxon's matched pairs test was used to analyse the data from Table W8.1 and to test the hypotheses:

H1: There is no difference between the median numbers of errors made by the volunteers in response to visual stimuli before or after drinking a moderate amount of alcohol.

H0: There is a difference between the median numbers of errors made by the volunteers in response to visual stimuli before or after drinking a moderate amount of alcohol.

Carry out this Wilcoxon's matched pairs test and in the answer box enter H1 if the null hypothesis is not rejected and enter H0 if the null hypothesis is rejected.

[If you would like to save a record of your answer, please type it into this Word document]

The correct answer is H0.

Full calculation:

  1. Hypotheses to be tested

H1: There is no difference between the median numbers of errors made by the volunteers in response to visual stimuli before or after drinking a moderate amount of alcohol.

H0: There is a difference between the median numbers of errors made by the volunteers in response to visual stimuli before or after drinking a moderate amount of alcohol.

  1. To work out T calculated

i. Let the number of errors made before drinking the alcohol be sample 1 and the number of errors recorded after drinking the alcohol be sample 2.

ii. and iii. The calculation table (W8.2) shows, in column 4, the difference (d) between each pair of observations. Where the observation for sample 2 is larger than the observation for sample 1 the difference is negative.

Table W8.2: Calculation of Wilcoxon's matched pairs test on the number of errors made before and after drinking a moderate amount of alcohol

Student

Response before intake of alcohol

Response after moderate intake of alcohol

Difference (d)

Absolute rank for d

Signed rank for d

1

5

3

2

10.5

10.5

2

2

3

-1

4.5

-4.5

3

4

3

1

4.5

4.5

4

2

3

-1

4.5

-4.5

5

1

1

0

   

6

3

4

-1

4.5

-4.5

7

3

3

0

   

8

3

1

2

10.5

10.5

9

5

4

1

4.5

4.5

10

2

2

0

   

11

7

13

-5

13

-13

12

2

4

-2

10.5

-10.5

13

2

1

1

4.5

4.5

14

0

2

-2

10.5

-10.5

15

1

0

1

4.5

4.5

16

2

1

1

4.5

4.5



iv. The absolute values of d (i.e. ignore the negative sign) have been ranked (column 5 of table W8.2). Any d value of zero is not included in this part of the calculation. If you are not confident in ranking data refer to BOX 3.3.

v. Where a d value had a negative sign these are now added to the rank value (column 6 Table W8.2).

vi. All the negative values in column 6 are added together

= (-4.5) + (-4.5) + (-4.5) + (-13) + (-10.5) + (-10.5) = - 47.5. This sign can be ignored again now! So the answer for this step is 46.

vii. All the positive values in column 6 can be added together

= 10.5 + 4.5 + 10.5 + 4.5 + 4.5 + 4.5 + 4.5 = 43.5

viii. The smaller value of these two values is the calculated value of T. For this example Tcalculated = 43.5.

  1. To find T critical

For this example three d values are zero, we only used 13 pairs of observations in our calculation so N = 13. At p = 0.05, Tcritical = 17.

  1. The rule

In this example Tcalculated (43.5) is more than Tcritical (17) therefore you do not reject the null hypothesis.

  1. What does this mean in real terms?

There is no significant difference (T = 43.5, p = 0.05) between the numbers of errors made by the volunteers in response to visual stimuli before or after drinking a moderate amount of alcohol.

Check your answer

We have also shown how to calculate this using the following software packages:

Excel

SPSS

Minitab

How to calculate Q W1.3 in Excel

There is no direct way of completing this calculation this using Excel.

How to calculate Q W1.3 in SPSS

Step 1: Set up the variables

When SPSS starts up, select 'variable view' using the tabs at bottom-left. You should get something like this:

SPSS: Step 1 (i)

For the first variable name, type in 'before', and for the second 'after'. Default properties will be set for each variable.

SPSS: Step 1 (ii)

The numbers of errors are integers, so change the 'decimals' property of both variables to zero. Click in the 'decimals' cell, and use the 'up-and-down' arrows that appear at the right-hand side of the cell to make the change.

SPSS: Step 1 (iii)

Transfer to 'data view' using the tabs at bottom-left.

Step 2: Enter the data.

SPSS: Step 2

Step 3: Perform the test.

Go to 'Analyze', 'Nonparametric Tests', '2 Related Samples'.

SPSS: Step 3 (i)

Click on 'before'. It will be registered as 'Variable 1'.

SPSS: Step 3 (ii)

Repeat for 'after' - this will be registered as 'Variable 2'. Now click on the arrow to transfer the pair into the 'Test Pair(s) List'.

SPSS: Step 3 (iii)

Check that 'Wilcoxon' is selected, and click on 'OK'. The results will appear in a separate window.

NPar Tests

Wilcoxon Signed Ranks Test

Wilcoxon Signed Ranks Test results

Step 4: Decide what the results mean.

The smallest 'sum of ranks' is 43.5, and the 'Asymp. Sig. (2-tailed)' is 0.886, which is larger than 0.05. Therefore we do not reject the null hypothesis, and conclude that there is no significant difference (T = 43.5, p = 0.05) between the numbers of errors made by the volunteers in response to visual stimuli before and after drinking a moderate amount of alcohol.

How to calculate Q W1.3 in Minitab

There doesn't seem to be an easy way to perform a Wilcoxon's matched pairs test in Minitab.