The Assumptions of ANOVA. Dennis Monday Gary Klein Sunmi Lee May 10, 2005. Major Assumptions of Analysis of Variance . The Assumptions Independence Normally distributed Homogeneity of variances Our Purpose Examine these assumptions Provide various tests for these assumptions Theory
Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.
procunivariate data=temp normal plot;
var expvar;
run;
procunivariate data=temp normal plot;
var normvar;
run;
Tests for Normality
Test Statistic p Value
ShapiroWilk W 0.731203 Pr < W <0.0001
KolmogorovSmirnov D 0.206069 Pr > D <0.0100
Cramervon Mises WSq 1.391667 Pr > WSq <0.0050
AndersonDarling ASq 7.797847 Pr > ASq <0.0050
Tests for Normality
Test Statistic p Value
ShapiroWilk W 0.989846 Pr < W 0.6521
KolmogorovSmirnov D 0.057951 Pr > D >0.1500
Cramervon Mises WSq 0.03225 Pr > WSq >0.2500
AndersonDarling ASq 0.224264 Pr > ASq >0.2500
Stem Leaf # Boxplot
22 1 1 
20 7 1 
18 90 2 
16 047 3 
14 6779 4 
12 469002 6 
10 2368 4 
8 005546 6 ++
6 228880077 9  
4 5233446 7  
2 3458447 7 **
0 366904459 9  + 
0 52871 5  
2 884318651 9  
4 98619 5 ++
6 60 2 
8 98557220 8 
10 963 3 
12 584 3 
14 853 3 
16 0 1 
18 4 1 
20 8 1 
++++
Multiply Stem.Leaf by 10**1
Normal Probability Plot
8.25+
 *


 *

 *
 +
4.25+ ** ++++
 ** +++
 *+++
 +++*
 ++****
 ++++ **
 ++++*****
 ++******
0.25+* * ******************
+++++++++++
Normal Probability Plot
2.3+ ++ *
 ++*
 +**
 +**
 ****
 ***
 **+
 **
 ***
 **+
 ***
0.1+ ***
 **
 ***
 ***
 **
 +***
 +**
 +**
 ****
 ++
 +*
2.1+*++
+++++++++++
2 1 0 +1 +2
Stem Leaf # Boxplot
8 0 1 *
7
7
6
6 1 1 *
5
5 2 1 *
4 5 1 0
4 4 1 0
3 588 3 0
3 3 1 0
2 59 2 
2 00112234 8 
1 56688 5 
1 00011122223444 14 +++
0 55555566667777778999999 23 **
0 000011111111111112222222233333334444444 39 ++
+++++++
procglm data=temp;
class trt;
model y = trt / p;
output out=out_ds r=resid_var;
run;
quit;
data out_ds;
set out_ds;
time = _n_;
run;
procgplot data=out_ds;
plot resid_var * time;
run;
quit;
procglm data=temp;
class trt;
model y = trt / p;
output out=out_ds r=resid_var;
run;
quit;
data out_ds;
set out_ds;
time = _n_;
run;
procgplot data=out_ds;
plot resid_var * time;
run;
quit;
First Order Autocorrelation 0.00479029
DurbinWatson D 1.96904290
First Order Autocorrelation 0.90931
DurbinWatson D 0.12405
procglm data=temp;
class trt;
model y = trt;
means trt / hovtest=levene hovtest=bf;
run;
quit;
procglm data=temp;
class trt;
model y = trt;
means trt / hovtest=levene hovtest=bf;
run;
quit;
Homogeneous Variances
The GLM Procedure
Levene's Test for Homogeneity of Y Variance
ANOVA of Squared Deviations from Group Means
Sum of Mean
Source DF Squares Square F Value Pr > F
TRT 1 10.2533 10.2533 0.60 0.4389
Error 98 1663.5 16.9747
Brown and Forsythe's Test for Homogeneity of Y Variance
ANOVA of Absolute Deviations from Group Medians
Sum of Mean
Source DF Squares Square F Value Pr > F
TRT 1 0.7087 0.7087 0.56 0.4570
Error 98 124.6 1.2710
Heterogenous Variances
The GLM Procedure
Levene's Test for Homogeneity of y Variance
ANOVA of Squared Deviations from Group Means
Sum of Mean
Source DF Squares Square F Value Pr > F
trt 1 10459.1 10459.1 36.71 <.0001
Error 98 27921.5 284.9
Brown and Forsythe's Test for Homogeneity of y Variance
ANOVA of Absolute Deviations from Group Medians
Sum of Mean
Source DF Squares Square F Value Pr > F
trt 1 318.3 318.3 93.45 <.0001
Error 98 333.8 3.4065
VARIANCE TESTS ARE ONLY FOR ONEWAY ANOVA
WARNING: Homogeneity of variance testing and Welch's ANOVA are only available for unweighted oneway models.
H0: σij2 = σi’j’2, For all i,j where i ≠ i’, j ≠ j’
data newgroup;
set oldgroup;
if block = 1 and treat = 1 then newgroup = 1;
if block = 1 and treat = 2 then newgroup = 2;
if block = 2 and treat = 1 then newgroup = 3;
if block = 2 and treat = 2 then newgroup = 4;
if block = 3 and treat = 1 then newgroup = 5;
if block = 3 and treat = 2 then newgroup = 6;
run;
procglm data=newgroup;
class newgroup;
model y = newgroup;
means newgroup / hovtest=levene hovtest=bf;
run;
quit;
procsort data=oldgroup; by treat block; run;
procmeans data=oldgroup noprint; by treat block;
var y;
output out=stats mean=mean median=median;
run;
data newgroup;
merge oldgroup stats;
by treat block;
resid = abs(mean  y);
if block = 1 and treat = 1 then newgroup = 1;
………
run;
procglm data=newgroup;
class newgroup;
model resid = newgroup;
run; quit;
procglm data=temp;
class sub;
model a1 a2 a3 = sub / nouni;
repeated as 3 (123) polynomial / summary printe;
run; quit;
Sphericity Tests
Mauchly's
Variables DF Criterion ChiSquare Pr > ChiSq
Transformed Variates 2 Det = 0 6.01 .056
Orthogonal Components 2 Det = 0 6.03 .062