loading

Logout succeed

Logout succeed. See you again!

ebook img

STAT 430, ANOVA PDF

pages26 Pages
release year2011
file size0.04 MB
languageEnglish

Preview STAT 430, ANOVA

STAT 430, ANOVA ------------------ ANOVA Examples with SAS =========================== ssh [email protected], tap sas913, sas https://www.statlab.umd.edu/sasdoc/sashtml/onldoc.htm Ex1: Speed Reading, One-Way ---------------------------- Randomly assign 15 subjects to 3 speed reading methods (3 treatment groups) X,Y,Z. Five subjects per reading method. Response: Number of words a subject reads per minute. X Y Z 700 480 500 850 460 550 820 500 480 640 570 600 920 580 610 Assuming normal distributions with equal variance, we test: H_0: mu_x=mu_y=mu_z, H_1: The means are not all equal OPTIONS PS=35 LS=70; DATA READING; INPUT GROUP $ WORDS @@; DATALINES; X 700 X 850 X 820 X 640 X 920 Y 480 Y 460 Y 500 Y 570 Y 580 1 Z 500 Z 550 Z 480 Z 600 Z 610 ; PROC ANOVA DATA=READING; TITLE "READING ANOVA"; CLASS GROUP; MODEL WORDS = GROUP; MEANS GROUP; RUN; READING ANOVA The ANOVA Procedure Class Level Information Class Levels Values GROUP 3 X Y Z Number of Observations Read 15 Number of Observations Used 15 READING ANOVA Dependent Variable: WORDS Sum of Source DF Squares Mean Square F Value Model 2 215613.3333 107806.6667 16.78 Error 12 77080.0000 6423.3333 Corrected Total 14 292693.3333 2 Source Pr > F Model 0.0003 REJECT H_0!!! Means not the same!!! Error Corrected Total R-Square Coeff Var Root MSE WORDS Mean 0.736653 12.98256 80.14570 617.3333 Level of ------------WORDS------------ GROUP N Mean Std Dev X 5 786.000000 113.929803 Y 5 518.000000 54.037024 Z 5 548.000000 58.051701 So, the means are not the same, which means that the reading methods are different. Therefore we perform Multiple Comparisons or Post Hoc analysis. Can choose: DUNCAN, SNK,LSD,TUKEY,SCHEFFE. For example: We use SNK MEANS GROUP/ SNK ALPHA=0.05; PROC ANOVA DATA=READING; TITLE "READING ANOVA"; CLASS GROUP; MODEL WORDS = GROUP; MEANS GROUP/ SNK ALPHA=0.05; RUN; The ANOVA Procedure 3 Student-Newman-Keuls Test for WORDS NOTE: This test controls the Type I experimentwise error rate under the complete null hypothesis but not under partial null hypotheses. Alpha 0.05 Error Degrees of Freedom 12 Error Mean Square 6423.333 Number of Means 2 3 Critical Range 110.44134 135.22484 ### ---> Means with the same letter are not significantly different. SNK Grouping Mean N GROUP A 786.00 5 X <---- X method best. B 548.00 5 Z <---- Z,Y methods are B the same. B 518.00 5 Y Do again with SCHEFFE: PROC ANOVA DATA=READING; TITLE "READING ANOVA"; CLASS GROUP; MODEL WORDS = GROUP; MEANS GROUP/ SCHEFFE ALPHA=0.05; RUN; The ANOVA Procedure Scheffe’s Test for WORDS 4 NOTE: This test controls the Type I experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 12 Error Mean Square 6423.333 Critical Value of F 3.88529 Minimum Significant Difference 141.3 Means with the same letter are not significantly different. Scheffe Grouping Mean N GROUP A 786.00 5 X B 548.00 5 Z B B 518.00 5 Y Get the same results as those from SNK. Now specific contrasts using PROC GLM. PROC GLM DATA=READING; TITLE "Study Contrasts"; CLASS GROUP; MODEL WORDS = GROUP; CONTRAST ’X VS. Y AND Z’ GROUP -1.3 0.65 0.65; CONTRAST ’X VS. Y’ GROUP -1 1 0; CONTRAST ’Y VS Z’ GROUP 0 1 -1; RUN; The GLM Procedure 5 Dependent Variable: WORDS Source Pr > F GROUP 0.0003 Source DF Type III SS Mean Square F Value GROUP 2 215613.3333 107806.6667 16.78 Source Pr > F GROUP 0.0003 Contrast DF Contrast SS Mean Square F Value X VS. Y AND Z 1 213363.3333 213363.3333 33.22 X VS. Y 1 179560.0000 179560.0000 27.95 Y VS Z 1 2250.0000 2250.0000 0.35 Contrast Pr > F X VS. Y AND Z <.0001 Different! X VS. Y 0.0002 Different! Y VS Z 0.5649 Same! Ex1.1: Two-Way Extension of Speed Reading Example ----------------------------------------------------- GROUP X Y Z 700 480 500 850 460 550 820 500 480 MALE 640 570 600 920 580 610 6 --------------- GENDER 900 590 610 880 540 660 899 560 525 FEMALE 780 570 610 899 555 645 Now we have 2 factors: GROUP (Levels X,Y,Z) and GENDER (Levels M,F) We have 5 observations per cell. So, I=3,J=2,K=5 OPTIONS PS=35 LS=70; DATA READING; INPUT GROUP $ GENDER $ WORDS @@; DATALINES; X M 700 X M 850 X M 820 X M 640 X M 920 Y M 480 Y M 460 Y M 500 Y M 570 Y M 580 Z M 500 Z M 550 Z M 480 Z M 600 Z M 610 X F 900 X F 880 X F 899 X F 780 X F 899 Y F 590 Y F 540 Y F 560 Y F 570 Y F 555 Z F 520 Z F 660 Z F 525 Z F 610 Z F 645 ; PROC ANOVA DATA=READING; TITLE "Two-Way Analysis of Reading Data"; CLASS GROUP GENDER ; MODEL WORDS = GROUP | GENDER; <--- "|" means main effects and interactions. MEANS GROUP | GENDER/ SNK; RUN; Two-Way Analysis of Reading Data The ANOVA Procedure Class Level Information Class Levels Values 7 GROUP 3 X Y Z GENDER 2 F M Number of Observations Read 30 Number of Observations Used 30 Dependent Variable: WORDS The ANOVA Procedure Class Level Information Class Levels Values GROUP 3 X Y Z GENDER 2 F M Number of Observations Read 30 Number of Observations Used 30 Dependent Variable: WORDS Sum of Source DF Squares Mean Square F Value Model 5 531436.1667 106287.2333 23.92 Error 24 106659.2000 4444.1333 Corrected Total 29 638095.3667 Source Pr > F 8 Model <.0001 Error Corrected Total Note Model df: (I-1)+(J-1)+(I-1)*(J-1)=2+1+2=5 Note Error df: IJ(K-1)=3*2*4=24 Note Total df: IKJ-1=3*2*5-1=29 Note: F=23.92 ====> means model ok. R-Square Coeff Var Root MSE WORDS Mean 0.832848 10.31264 66.66433 646.4333 Source DF Anova SS Mean Square F Value GROUP I-1=2 503215.2667 251607.6333 56.62 GENDER J-1=1 25404.3000 25404.3000 5.72 GROUP*GENDER (I-1)*(J-1)=2 2816.6000 1408.3000 0.32 The ANOVA Procedure Dependent Variable: WORDS Source Pr > F GROUP <.0001 Reject alpha effects are zero. GENDER 0.0250 Reject beta effects are zero. GROUP*GENDER 0.7314 No interaction. Student-Newman-Keuls Test for WORDS 9 NOTE: This test controls the Type I experimentwise error rate under the complete null hypothesis but not under partial null hypotheses. Alpha 0.05 Error Degrees of Freedom 24 Error Mean Square 4444.133 Number of Means 2 3 Critical Range 61.53152 74.452114 Means with the same letter are not significantly different. SNK Grouping Mean N GROUP A 828.80 10 X NOTE: Across GENDER 5+5=10 B 570.00 10 Z B B 540.50 10 Y So we see method X is significantly better than Y,Z. Student-Newman-Keuls Test for WORDS NOTE: This test controls the Type I experimentwise error rate under the complete null hypothesis but not under partial null hypotheses. Alpha 0.05 Error Degrees of Freedom 24 Error Mean Square 4444.133 Number of Means 2 10

See more

The list of books you might like