Exercise 1
The aim of this exercise is to test your understanding of section 7.3 and draws also on BOX 7.1 in section 7.1 and appendix b. This example also illustrates what is meant by the term absolute.
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 of 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. As part of the investigation the reaction rates to a number of visual stimuli was recorded before and after the consumption of the alcohol and the mean time (ms) to complete all the tasks was recorded (Table W7.1). (An extension to this investigation is included in interactive exercise 1 in chapter 8). The undergraduate tested the hypothesis that there is no difference in mean reaction times (ms) before and after the consumption of a moderate amount of alcohol in this cohort.
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 |
1 |
Full answer to Q W1.1
- What type of investigation am I designing?
Experimental: you are starting out with a question (hypothesis).
- Which type of hypotheses am I testing?
There are three types of hypotheses which you need to choose between. If you are not sure which type of hypotheses you will be testing read the information in B.2.1 - B.2.3 before deciding. For more information about hypotheses and hypothesis testing read Chapter 4.
Does the data match an expected ratio?
or
Is there an association between two or more variables?
or
Do samples come from the same or different populations?
In this example the student wishes to test the third type of hypothesis.
- Do samples come from the same or different populations?
These are the type of hypotheses that are most frequently investigated by undergraduates. There are many tests that will test this type of hypotheses. These tests fall into parametric tests (Chapter 7) to be used when you have Normally distributed data, and non-parametric tests (Chapter 8), when your data are not Normally distributed. To tell if your data are Normally distributed refer to BOX 3.2.
Are the data from Example W7.1 (Table W7.1) parametric?
To answer this we have used the first four criteria in BOX 3.2. This suggests that the data are parametric.
To tell if your data are probably Normally distributed and therefore you may use parametric statistics you should check against (at least) the first four criteria.
- Are the data measured on an interval scale and is therefore quantitative and continuous such as mm and grams?
Yes. The scale of measurement is ms which is a quantitative and continuous scale.
- Do the distributions appear to be a 'bell' shaped curve?
Frequency tables of the mean reaction time (ms) before consumption of alcohol and after consumption of alcohol does suggest a bell shaped curve for both sets of data (Table W7.2).
Table W7.2: Frequency table indicating distribution of data for mean reaction times (ms) before and after consuming a moderate amount of alcohol
Frequency |
classes |
for |
mean |
reaction |
times (ms) |
|
|---|---|---|---|---|---|---|
350.00000 - 399.99999 |
400.00000 - 449.99999 |
450.00000 - 499.99999 |
500.00000 - 549.99999 |
550.00000 - 599.99999 |
600.00000 - 649.99999 |
|
Before consumption of alcohol |
2 |
3 |
7 |
2 |
1 |
1 |
After consumption of alcohol |
1 |
2 |
6 |
5 |
1 |
1 |
- Do at least 68% of your observations fall within the range ± 1 s?
The summary statistics are included in Table W7.3 and have been calculated with reference to BOX 3.1. You can use software packages to carry out these calculations. Examples are included on this website in 'Chapter 3'.
Table W7.3: Mean response time (ms) to visual stimuli before and after consuming 3 units of alcohol over a two hour period
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 |
479.73958 |
494.73333 |
|
s |
57.11995 |
59.01012 |
s2 |
3262.68827 |
3482.19365 |
7675.83323 |
7915.73337 |
|
3731341.31 |
3968410.079 |
|
n |
16 |
16 |
Before consuming alcohol
The range of ± s is given by + s = 536.85952 and - s = 422.61963. 11/16 observations (i.e. 68.75%) are found within this range. Therefore, for the 'before' data this criterion is met.
After consuming alcoholThe range of ± s is given by + s = 553.74345 and - s = 435.72322. 14/16 observations (i.e. 87.5%) are found within this range. Therefore, for the 'before' data this criterion is met, though it should be noted that this figure is high.
This can be a difficult criterion to use as it is not clear how much difference there can be between these values before they indicate that the data is not parametric.
Before consuming alcoholThe mean is given in Table W7.3, the mode can be calculated from Table W7.2 and the median from Table W7.1.
= 479.73958
The mode is the mid point of the class 450.00000 to 499.99999 = 474.99999
The median lies half way between 475.48333 and 479.05000 = 477.26666
Therefore, for the 'before consuming alcohol' data these three values are similar and do support the idea that the data are parametric.
After consuming alcoholThe mean is given in Table W7.3, the mode can be calculated from Table W7.2 and the median from Table W7.1.
= 494.73333
The mode is the mid point of the class 450.00000 to 499.99999 = 474.99999
The median lies halfway between 489.08333 and 494.73333 = 491.908315
These values are similar but not as close as the 'before' data set. It is difficult to know if this criterion is met for the 'after consuming alcohol' data.
- Parametric tests
These are largely selected on the basis of the experimental design - how many variables, how many categories in each variable, how many replicates in each category. In this example there is one treatment variable (consumption of alcohol), and the data are matched so we should refer to 7.3. to enable us to choose between the t and z tests for matched pairs.
In 7.3.1 the criteria for using either a z or t test for matched pairs are given. The table shows which of these criteria are met and therefore lead us to making our final decision about which is the most appropriate test to use.
|
Criterion. To use these tests you: |
Is this criterion met? |
|---|---|
|
1. Wish to test for differences in population means |
Yes |
|
2. Have one treatment variable and two samples. |
Yes the treatment variable is 'consumption of alcohol', the two samples are the mean reaction times (ms) before and after consuming the alcohol. |
|
3. Have data that are matched and therefore the sample sizes are equal. |
Yes. For each volunteer a 'before' and 'after' measure was taken. Therefore the data are matched. |
|
4. Have samples in which the variances are similar (homogeneous). |
To check this criterion you use the F test that precedes a t or z test (BOX 7.1). For this example F = 3482.193651 / 3262.688272 = 1.06728 The degrees of freedom ( Fcritical at p = 0.05 = 2.86. Since Fcalculated is less than Fcritical we may not reject the null hypothesis, there is no significant difference between the two sample variances, and we may proceed with the paired t or z test. |
|
5a. Have 30 or more pairs of observations and the data are parametric. In this case you may consider using the z test for matched data. Or 5b. Have less than 30 pairs of observations and the data are parametric. In this case you may consider using a t test for matched data. |
This criterion allows us to make our final selection of test. Since we only have 16 pairs of observations we use the matched pairs t test and not the z test. |
2 |
Full answer to Q W1.2
- Hypotheses to be tested
H0: There is no difference between the mean reaction times (ms) to visual stimuli before and after drinking 3 units of alcohol over a two hour period.
H1: There is a difference between the mean reaction times (ms) to visual stimuli before and after drinking 3 units of alcohol over a two hour period.
- How to work out t calculated
- The differences between each pair of observations is included in Table W7.3 (column 4).
- The method for calculating a variance is given in BOX 3.1. The results for this example are included in Table W7.4.
Table W7.4: Calculation of differences between mean response times (ms) before and after consuming 3 units of alcohol over a two hour period.
Volunteer |
Mean response times (ms) before consumption of alcohol |
Mean response times (ms) after consumption of alcohol |
Difference (D) |
|---|---|---|---|
1 |
486.38330 |
489.08333 |
-2.70003 |
2 |
388.73330 |
362.70000 |
26.0333 |
3 |
496.08333 |
553.66667 |
-57.58334 |
4 |
443.41667 |
446.63333 |
-3.21666 |
5 |
479.05000 |
626.06670 |
-147.0167 |
6 |
571.56660 |
546.21667 |
25.34993 |
7 |
447.78333 |
477.63333 |
-29.84997 |
8 |
475.48333 |
469.15000 |
6.33333 |
9 |
600.66667 |
476.50000 |
124.16667 |
10 |
440.50000 |
544.23333 |
-103.73333 |
11 |
394.11667 |
495.23333 |
-101.11663 |
12 |
544.08333 |
470.36667 |
73.71666 |
13 |
454.81667 |
515.06667 |
-60.25 |
14 |
456.08333 |
501.40000 |
-45.31667 |
15 |
494.41667 |
431.11667 |
63.30000 |
16 |
502.6500 |
510.66667 |
-8.01667 |
479.73958 |
494.73333 |
|
|
s |
57.11995 |
59.01012 |
|
s2 |
3262.68827 |
3482.19365 |
s2D = 5012.89189 |
7675.83323 |
7915.73337 |
||
3731341.31 |
3968410.079 |
||
n |
16 |
16 |
- SED = √(5012.89189/ 16) = √313.30574 = 17.70044
- tcalculated =
= -14.99376 / 17.70044 = - 0.84708
- How to find t critical
tcritical = 2.131.
- The rule
In this test we use the absolute value of tcalculated . In other words we ignore the negative sign at this point. Therefore since tcalculated (0.84708) is less than tcritical (2.131) at p = 0.05, we do not reject the null hypothesis.
- What does this mean in real terms?
There is no statistically significant correlation (tcalculated = 0.847, p = 0.05) between the mean reaction times (ms) to visual stimuli before and after drinking 3 units of alcohol over a two hour period.
How to calculate Q W1.2 in Excel
Step 1: Put the data into the spreadsheet using appropriate row and column headings.
.

Step 2. From the top tool bar select, Tools then Data Analysis from the drop down menu.
Step 3. In the Data Analysis box, scroll down and select the Analysis Tool: t-Test: Paired Two Sample for Means. Click OK.

Step 4: Input values as indicated in the box.

Ensure that the cursor is flashing in the Variable 1 Range: Input box. Input the cell references of the data by clicking on cell B1 (this includes the data or sample label) and dragging down the column to the last cell containing data. The area on the spreadsheet will now be highlighted and the cell references shown in the input box.
Step 5: Click in the box marked Variable 2 Range: and repeat the process with the second column of data.
Step 6: The hypothesised mean difference under the null hypothesis is zero so enter 0 in the box below or leave it blank (as 0 will be assumed).
Step 7: The box marked Labels should be clicked, this will put a tick in the box which shows that the first cell for each data set contains a label and not data. If this box is not ticked, Excel will treat the material in the first cell as data and will not be able to complete the calculation. Note that it is useful to use the labels to identify your data. These labels are used by Excel to identify the output data.
Step 8: The default value for alpha (p) is 0.05 but this can be changed if required, but you will not normally need to do so.
Step 9: Next, select the output options. To return the output data below the input data, select 'Output Range:' and then click in the box (the cursor will now flash in the box). Scroll over an area where you want the results to be displayed. Note that you could just select a couple of cells - Excel will determine the actual size that it requires for the results table. Note too, that it is essential to click in the box as well as selecting the 'Output Range' button. If this is not done the location is entered into the 'Input Range' box and the analysis cannot be completed.
Step 10: You can choose to have the results entered on to a 'New Worksheet Ply', in which case the results will be given on a fresh sheet, accessed by the tabs at the bottom of the current sheet. Alternatively a 'New Workbook' can be selected. We have opted to put the results table beneath the original data on the spreadsheet.
Step 11:Click OK and the Results table will be returned.

Step 12: Select the required values from the results table.
The value of tcalc is given as t Stat and is -0.8471 (to 4 decimal places).
The value of tcrit is given as t Critical two-tail and is 2.1315.
As tcalc < tcrit do not reject H0.
The result is not significant, NS and the probability is quoted as 0.4103.
Therefore there is no statistical difference between the mean response times before and after the consumption of alcohol.
How to calculate Q W1.2 in SPSS
Step 1: Set up the variables
When SPSS starts up, select 'variable view' using the tabs at the bottom-left. You should get something like this:

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

Both 'before' and 'after' response times are given to five(!) decimal places, so we need to change the 'decimals' property of both variable to 5. 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 changes.

Transfer to data view using the tabs at bottom-left, and enter the data. To fit in all the significant figures, you may need to stretch the widths of the cells by dragging the boundaries between the column headings.

Step 2: Perform the test.
Go to 'Analyze', 'Compare means', 'Paired samples t-test'.

Click on 'before', and it will become 'variable 1' of the pair. Click on 'after', and it will become 'variable 2'. Click on the arrow to transfer the pair to the 'paired variables' window.

Click on 'OK'. The output will appear in a separate window.
t-Test

Step 3: Decide what the result means.
In the last table of the output, the value of t is given as -0.847. The column headed 'Sig. (2-tailed)' gives the p-value for this test, which is 0.410. This is much larger than 0.05. We therefore conclude that there is no statistically significant correlation (tcalculated = -0.847, p = 0.05) between the mean reaction times (ms) to visual stimuli before and after drinking 3 units of alcohol over a two hour period.
How to calculate Q W1.2 in Minitab
Step 1. Put your data into the Minitab worksheet. Use sensible column headings.

The default setting seems to be to display a maximum of three decimal places. To change this, click on the column heading (for example, 'c1'), right-click anywhere in the column, and select 'format column', 'numeric'.

Change the format from 'automatic format' to 'fixed decimal with 5 decimal places' (our data has five decimal places).

Click on 'OK', and repeat for the other column.

Step 2. Perform the test.
Go to 'Stat', 'Basic statistics', 'paired t'.

Click in the window for 'first sample', highlight your first sample column, and click on 'select' to transfer it across. Repeat for the second sample.

Click on 'OK'. The results will appear in the session window.
Paired t-Test and CI: before, after

*(T here is not T from the Tukeys test but t from the t test. CI are confidence intervals).
Step 3: Decide what the results mean.
The value of t in this case is -0.85, and the associated p-value is 0.410. This is larger than 0.05, and therefore we conclude that there is no significant difference (t = 0.85, p = 0.05) between the mean reaction times (ms) to visual stimuli before and after drinking 3 units of alcohol over a two hour period.
3 |
Further points for discussion:
When the data in this experiment was analysed the student used the mean reaction times for each person? Why is this not ideal? What would be an alternative approach and how would this data be analysed?