|
|

Practice
Computer
Programs
SAS
headstart
SAS procedures
Program
1
Program
2
Program
3
Program
4
Program
5
Program
6
Program
7
Program
8
Program
9
Program
10
Program
11
Program
12
Program
13
Program
14
Topical
Bibliographies (Readings)
Datasets
and Stories
Software
Help
Search
for
|

|
SAS
PROCEDURE for ANALYSIS OF VARIANCE

PROC
GLM;
1. Purpose: compare means obtained from an ANOVA design
2. Syntax:
PROC GLM data=data set name ;
CLASS vars ;
MODEL dep var=effects ;
MEANS effects/options ;
TEST H=effects E=error ;
MANOVA H=effects E=error ;
REPEATED vars ;
BY classification vars ;
3. Simple Main Effects
PROC GLM;
CLASS A B C;
MODEL Y=A B C;
4. Interaction and Main Effects
PROC GLM;
CLASS A B C;
MODEL Y=A B C A*B
B*C A*C A*B*C;
(or MODEL Y=A|B|C;)
5. Nested Effects
PROC GLM;
CLASS A B C;
MODEL Y=A B C(A B);
6. MEANS effects/options;
Options are :
TUKEY = HSD or WSD procedure
SCHEFFE = Scheff`e procedure
BON = Bonferroni t-test
SIDAK = Dunn-Sidak pairwise procedure
DUNNETT('j') = The Dunnette procedure where j=control group
SNK = Newman-Keuls procedures
LSD = least significant differences
CLDIFF = 95% Confidence interval
ALPHA = significance level
(default = .05)
For Example,
MEANS A B A*B/ SNK ALPHA = 10;
will perform the Newman-Keuls test, at a = 10%, of group
mean differences on A and B main factors. The A*B
interaction generates all of cell means without actually
testing them.
7. The PROC GLM also allows us to test planned <orthogonal or
nonorthogonal> contrasts by using the CONTRAST statement.
The general syntax is
CONTRAST 'label' effect coefficients;
For example,
CONTRAST 'A LINEAR & QUADRATIC'
A -2 -1 0 1 2,
A 2 -1 -2 -1 2;
will carry out two trend analyses, one on the linear trend
of Factor A and the other on the quadratic trend of Factor A.
In order to carry out a test on the interaction term, such as
A*B, you need at least four cell means. The following are two
orthogonal contrasts tested by the CONTRAST statements:
CONTRAST 'The first and the second contrasts'
A*B 1 -1 0 -1 1 0,
A*B .5 .5 -1 -.5 -.5 1;
CONTRAST statement should be placed anywhere after PROC GLM,
CLASS, and MODEL statements.

Comments: peng@indiana.edu
Dr. Peng's Home Page: Dr.
Chao-Ying Joanne Peng
Copyright
1999, The Trustees of Indiana
University
|