1
One Within-Subjects Factor: Pairwise Comparisons
To study the relationship between alcohol consumption and reaction time,reaction time was measured under each of four conditions. Conditions were defined interms of the amount of alcohol consumed 30 minutes prior to measuring reaction time.
Four levels of alcohol were used: 0, 2, 4, and 6 ounces of alcohol. Each of eight subjects
took part in each treatment. Treatments were administered one week apart. For eachsubject the order of the treatments was randomly selected from the 24 possible orders.
Input the data in the fashion appropriate for a one-way within-subjects
design:2Conduct a one-way within-subjects ANOVA. At the top of the out put your willfind the following SPSS syntax:
GLM
RT0 RT2 RT4 RT6/WSFACTOR = ALCOHOL 4 Polynomial/METHOD = SSTYPE(3)/PRINT = DESCRIPTIVE/CRITERIA = ALPHA(.05)/WSDESIGN = ALCOHOL .

Double click on the text and copy the text from GLM to the period. With the SPSS Data Editor
displayed, click File → Syntax and paste the test into the window. Then put the curser before theperiod and hit Enter twice”

Add the following text between /WSDESIGN = ALCOHOL and the period:/MMATRIX = "0 vs 2" RT0 1 RT2 -1;“0 vs 4" RT0 1 RT4 -1;"0 vs 6" RT0 1 RT6 -1;

3"2 vs 4" RT2 1 RT4 -1;"2 vs 6" RT2 1 RT6 -1;"4 vs 6" RT0 4 RT6 -1;

The first line of code instructs the computer to compare the means for RT0 and RT2 andthe last line of code instructs the computer to compare the means for RT4and RT6. Hereis the final syntax window:

Once the code is typed correctly go to the output and delete it because the newprogram will duplicate the output of the original program. If you wish you can save thesyntax so you can reuse it. To run the program, click Run → All. The results to test thecontrasts are labeled Custom Hypothesis Tests. Unlike in the one between-subjects
design, all pairwise comparison results are presented in one array:4Custom Hypothesis Tests
Contrast Results (K Matrix)
Contrast(a)L1Transformed Variable
Contrast Estimate

0 vs 2-.750

0 vs 4-3.500

0 vs 6-6.250

2 vs 4-2.750

2 vs 6-5.500

4 vs 62.000

000000-.750-3.500-6.250-2.750-5.5002.000.250

.267

.250

.164

.189

1.711

Hypothesized Value
Difference (Estimate - Hypothesized)
Std. Error
Sig.
95% Confidence Interval
for Difference.020.000.000.000.000.281

Lower Bound-1.341-4.132-6.841-3.137-5.947-2.047Upper Bound-.159-2.868-5.659-2.363-5.0536.047

a Estimable Function for Intercept

As usual t statistics are computed as the ratio of the estimate to the standard error. For example to compare the means for 0 and 2ounces of alcohol consumption the t statistic is−.75= 3.00.
.25
Alternatively, following the Custom Hypothesis Tests are tables labeled Multivariate Test Results and Univariate Test Results. Ignore
t=the Multivariate Test Results. The t statistics for the pairwise comparison can be obtained from the Univariate Test Results by taking
the square root of F. For example to compare the means for 0 and 2 ounces of alcohol consumption the t statistic is5t = 9 = 3.00.

Multivariate Test Results

Pillai's trace
Wilks' lambdaValue.994

F154.200(a)Hypothesis df
4.000

Error df
4.000

Sig.
.000

.006

154.200(a)4.000

4.000.000

Hotelling's trace

154.200

154.200(a)

4.000

4.000

.000

Roy's largest root

154.200

154.200(a)4.000

4.000.000

a Exact statistic

Univariate Test Results

SourceContrast

Error

Transformed Variable
0 vs 2Sum ofSquares
4.500

df
1

Mean Square
4.500

F
9.000

Sig.
.020

0 vs 498.000198.000

171.500.000

0 vs 6312.5001

312.500

625.000.000

2 vs 460.500

160.500

282.333.000

2 vs 6242.000

1242.000

847.000.000

4 vs 632.000132.000

1.366

.281

0 vs 23.500

7.500

0 vs 4

4.000

7.571

0 vs 6

3.500

7.500

2 vs 4

1.500

7.214

2 vs 6

2.000

7.286

4 vs 6164.000

723.429

Here are the results produced by the syntax. As usual with a within-subject
design the following results can be ignored:
1. Multivariate tests.
2. Mauchly’s test of sphericity (except epsilon).
3. Tests of within-subjects contrasts.

6General Linear Model
Within-Subjects Factors
Measure: MEASURE_1
ALCOHOL12
3
4

Dependent
VariableRT0
RT2
RT4
RT6

Descriptive Statistics
RT0RT2
RT4
RT6Mean
2.75
3.506.25
9.00

Std. Deviation
1.488
.926
1.035
1.309

N8888

Multivariate Testsb
Effect
ALCOHOL

Pillai's Trace
Wilks' Lambda
Hotelling's Trace
Roy's Largest Root

Value.994.006
153.667
153.667

a. Exact statisticb.
Design: Intercept
Within Subjects Design: ALCOHOL

F
Hypothesis df
256.111a3.000
a256.1113.000
256.111a
3.000
256.111a
3.000

Error df
5.000
5.000
5.000
5.000

Sig.
.000
.000
.000.000

7Mauchly's Test of Sphericityb
Measure: MEASURE_1
EpsilonWithin Subjects Effect
ALCOHOL

Mauchly's W.633

Approx.
Chi-Square
2.618

df5Sig.
.762

Greenhouse-Geisser.762

aHuynh-Feldt
1.000

Lower-bound.333

Tests the null hypothesis that the error covariance matrix of the orthonormalized transformed dependent variables is
proportional to an identity matrix.
a. May be used to adjust the degrees of freedom for the averaged tests of significance. Corrected tests are displayed inthe Tests of Within-Subjects Effects table.
b.
Design: Intercept
Within Subjects Design: ALCOHOL

Tests of Within-Subjects Effects
Measure: MEASURE_1
Source
ALCOHOL

Error(ALCOHOL)

Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-boundSphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-boundType III Sum
of Squares
194.500
194.500
194.500
194.500
4.000
4.000
4.000
4.000

df
3
2.286
3.000
1.000
21
16.00021.0007.000

Mean Square
64.83385.09464.833194.500
.190
.250
.190
.571

F
340.375
340.375
340.375
340.375

Sig.
.000
.000
.000
.000

8

Tests of Within-Subjects Contrasts
Measure: MEASURE_1
Source
ALCOHOL

Error(ALCOHOL)ALCOHOL
LinearQuadratic
Cubic
LinearQuadratic
Cubic

Type III Sum
of Squares
184.900
8.000
1.600
1.800
1.500.700

df111777

Mean Square
184.900
8.000
1.600.257.214.100

Tests of Between-Subjects Effects
Measure: MEASURE_1
Transformed Variable: Average
SourceInterceptError

Type III Sumof Squares
924.500
37.000df
1
7

Custom Hypothesis Tests

Mean Square
924.500
5.286

F
174.905

Sig.
.000

F
719.056
37.33316.000Sig.
.000.000.005

9

Contrast Results (K Matrix)
aContrast
L1

Contrast Estimate
Hypothesized Value
Difference (Estimate - Hypothesized)
Std. Error
Sig.
95% Confidence Interval
for DifferenceLower Bound
Upper Bound

0 vs 2-.750
00 vs 4-3.500
0-.750-3.500-6.250.250.020-1.341-.159.267.000-4.132-2.868.250.000-6.841-5.659Error df
4.000
4.000
4.000
4.000

Sig.
.000
.000
.000
.000

a. Estimable Function for Intercept

Multivariate Test Results
Pillai's trace
Wilks' lambda
Hotelling's trace
Roy's largest roota. Exact statistic

Value
.994
.006
154.200
154.200

F
Hypothesis df
154.200a4.000
a154.200
4.000
154.200a4.000
a154.200
4.000

Transformed Variable
0 vs 6
2 vs 4-6.250-2.75000

2 vs 6-5.500
0

4 vs 62.000
0-2.750-5.500

2.000

.164
.000
-3.137-2.363.189.000-5.947-5.0531.711.281-2.0476.047

10Univariate Test Results
SourceContrast

Error.

Transformed Variable
0 vs 20 vs 40 vs 6
2 vs 4
2 vs 6
4 vs 6
0 vs 20 vs 40 vs 6
2 vs 4
2 vs 6
4 vs 6

Sum ofSquares
4.500
98.000312.500
60.500242.000
32.000
3.500
4.000
3.500
1.500
2.000
164.000

df
11111
1
777
777

Mean Square
4.500
98.000312.500
60.500242.000
32.000.500.571.500.214.286
23.429F
9.000
171.500
625.000
282.333
847.000
1.366

Sig.
.020.000.000.000.000.281

11One Within-Subjects Factor: Orthogonal Polynomial Analysis
The alcohol data are also used to illustrate using SPSS to obtain tests of theorthogonal polynomial contrasts. Follow the steps for the pairwuse comparisons.
However replace this text:/MMATRIX = "0 vs 2" RT0 1 RT2 -1;“0 vs 4" RT0 1 RT4 -1;"0 vs 6" RT0 1 RT6 -1;"2 vs 4" RT2 1 RT4 -1;"2 vs 6" RT2 1 RT6 -1;"4 vs 6" RT0 4 RT6 -1;

by this text
/MMATRIX = "linear"
RT0 -3 RT2 -1 RT4 1 RT6 3;"quadratic" RT0 1 RT2 -1 RT4 -1 RT6 1;"cubic"
RT0 -1 RT2 3 RT4 -3 RT6 1;

As usual t statistics are computed as the ratio of the estimate to the standard error with theresults found in the section labeled Custom Hypothesis Tests. For example, to test thelinear trend the t statistic ist=21.5= 26.82.
.802

Alternatively, following the Custom Hypothesis Tests are tables labeled Multivariate Test
Results and Univariate Test Results. Ignore the Multivariate Test Results. The t statistics
for the polynomial analysis can be obtained from the Univariate Test Results by taking
the square root of F. For example to test the linear trend the t statistic is12t = 719.056 = 26.82.
As usual with a within-subject design the following results can be ignored:
1. Multivariate tests.
2. Mauchly’s test of sphericity (except epsilon).
3. Tests of within-subjects contrasts.
Here are the results:

General Linear Model

Within-Subjects Factors
Measure: MEASURE_1
ALCOHOL1
2
34Dependent
Variable
RT0
RT2
RT4
RT6

Descriptive Statistics
RT0RT2
RT4RT6Mean
2.75
3.50
6.25
9.00

Std. Deviation
1.488.926
1.035
1.309

N8888

13

Multivariate Testsb
Effect
ALCOHOL

Pillai's Trace
Wilks' Lambda
Hotelling's Trace
Roy's Largest Root

Value.994.006
153.667
153.667

FHypothesis df
256.111a
3.000
256.111a
3.000
256.111a3.000
a256.1113.000

Error df
5.000
5.000
5.000
5.000

Sig.
.000
.000
.000.000

a. Exact statisticb.
Design: Intercept
Within Subjects Design: ALCOHOL

Mauchly's Test of Sphericityb
Measure: MEASURE_1
EpsilonWithin Subjects Effect
ALCOHOL

Mauchly's W.633

Approx.
Chi-Square
2.618

df5Sig.
.762

Greenhouse-Geisser.762

aHuynh-Feldt
1.000

Lower-bound.333

Tests the null hypothesis that the error covariance matrix of the orthonormalized transformed dependent variables is
proportional to an identity matrix.
a. May be used to adjust the degrees of freedom for the averaged tests of significance. Corrected tests are displayed inthe Tests of Within-Subjects Effects table.
b.
Design: Intercept
Within Subjects Design: ALCOHOL14

Tests of Within-Subjects Effects
Measure: MEASURE_1
Source
ALCOHOL

Error(ALCOHOL)

Sphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-boundSphericity Assumed
Greenhouse-Geisser
Huynh-Feldt
Lower-boundType III Sum
of Squares
194.500
194.500
194.500
194.500
4.000
4.000
4.000
4.000

df
3
2.286
3.000
1.000
21
16.00021.0007.000

Mean Square
64.83385.09464.833194.500
.190
.250
.190
.571

F
340.375
340.375
340.375
340.375

Tests of Within-Subjects Contrasts
Measure: MEASURE_1
Source
ALCOHOL

Error(ALCOHOL)ALCOHOL
LinearQuadratic
Cubic
LinearQuadratic
Cubic

Type III Sum
of Squares
184.900
8.000
1.600
1.800
1.500.700

df111777

Mean Square
184.900
8.000
1.600.257.214.100F
719.056
37.33316.000Sig.
.000.000.005

Sig.
.000
.000
.000
.000

15

Tests of Between-Subjects Effects
Measure: MEASURE_1
Transformed Variable: Average
SourceIntercept
Error

Type III Sum
of Squares
924.500
37.000df
17

Mean Square
924.500
5.286

F
174.905

Sig.
.000

Custom Hypothesis Tests
Contrast Results (K Matrix)
aContrast
L1

Contrast Estimate
Hypothesized Value
Difference (Estimate - Hypothesized)
Std. Error
Sig.
95% Confidence Interval
for Differencea. Estimable Function for Intercept

Lower Bound
Upper Bound

Transformed Variablelinearquadratic
cubic
21.5002.000-2.000000
21.5002.000-2.000.802.000
19.60423.396

.327
.000
1.226
2.774

.500
.005
-3.182-.818

16Multivariate Test Results
Pillai's trace
Wilks' lambda
Hotelling's trace
Roy's largest root

Value.994.006
153.667
153.667

FHypothesis df
256.111a3.000
a256.111
3.000
256.111a3.000
a256.1113.000

Error df
5.000
5.000
5.000
5.000

Sig.
.000.000.000.000

a. Exact statistic

Univariate Test Results
SourceContrast

Error

Transformed Variablelinearquadratic
cubic
linearquadratic
cubic

Sum ofSquares
3698.000
32.00032.00036.0006.000
14.000

df
1
1
1
7
77

Mean Square
3698.000
32.00032.0005.143.857
2.000

F
719.056
37.33316.000Sig.
.000.000.005