UCLA Academic Technology Services HomeServicesClassesContactJobs
Search

SAS Textbook Examples
Design and Analysis by Keppel
Chapter 7

Chapter 7: Analysis of Trend

7. Trend Analysis in a One Way ANOVA, Pages 143-150 of Keppel
  Example 7a. SPSS MANOVA
  Example 7b. SPSS GLM 
  Example 7c. SAS PROC GLM 

7. Trend Analysis in a One Way ANOVA, Pages 143-150 of Keppel

Pages 143-150 of Keppel illustrate how to perform trend analysis in a one way Analysis of Variance.  This example compares the comprehension score (score) for three different instruction techniques. The data for this experiment is shown below.

a=1 a=2 a=3 a=4
7
9
9
9
9
11
12
12
14
14
13
18
18
20
20
20
21
22
22
24
13
18
12
17
16
20
21
22
22
22
25
25
21
23
25
24
22
26
27
26
19
20
19
19
19
20
21
22
23
23
25
22
24
24
25
25
26
26
26
28
13
12
14
11
16
17
17
18
22
21
19
23
23
23
24
24
25
25
29
25

This can be analyzed using SPSS manova, SPSS glm, or SAS proc glm. All of these examples use the CHAP7 (SPSS, SAS) data file. The following examples illustrate two comparisons: first, a comparison of group 1 with groups 2 and 3, and second a comparison of groups 2 and 3.

Example 7a. SPSS MANOVA

MANOVA numcorr BY a(1,4)
  /ERROR = W
  /CONTRAST(a) = POLYNOMIAL
  /DESIGN = a(1) a(2) a(3) . 

The /contrast subcommand is used to specify comparisons among treatment means and we use the special keyword polynomial to indicate that we want orthogonal trend coefficients.  Since there are 4 levels of factor a there can be thee tests of trend, linear, quadratic and cubic.  On the /design subcommand, a(1) refers to the test of linear trend, a(2) refers to a test of quadratic trend, and a(3) refers to a test of cubic trend. 

Finally, the  /error=w is shown even though it was not necessary in this situation.  If we had only included one or two of the tests of trend on the /design subcommand, then we would have wanted to include the /error=w to tell SPSS to use the within cells variance for computing the error term.  Otherwise, some versions of SPSS use WITHIN+RESIDUAL as the error term and this would be a less powerful test due to the addition of residual variance in the error term. 

Example 7b. SPSS GLM

GLM numcorr BY a
  /LMATRIX a -3 -1  1  3
  /LMATRIX a  1 -1 -1  1
  /LMATRIX a -1  3 -3  1. 

or

GLM numcorr BY a
/CONTRAST(a) = POLYNOMIAL. 

Example 7c. SAS PROC GLM

PROC GLM DATA=chap7;
  CLASS a;
  MODEL numcorr = a;
  CONTRAST "a linear" a -3 -1  1  3 ;
  CONTRAST "a quad"   a  1 -1 -1  1 ;
  CONTRAST "a cubic"  a -1  3 -3  1 ;
RUN; 

Summary

Under construction.


How to cite this page

Report an error on this page

UCLA Researchers are invited to our Statistical Consulting Services
We recommend others to our list of Other Resources for Statistical Computing Help
These pages are Copyrighted (c) by UCLA Academic Technology Services


The content of this web site should not be construed as an endorsement of any particular web site, book, or software product by the University of California