One-Way ANOVA Model #2

Fixed-Effects Model with Test for Homoscedasticity

Rust Inhibitor Example

Program Listing

filename ri URL "http://www.stat.lsu.edu/exstweb/statlab/datasets/KNNLData/CH17TA02.txt";
PROC FORMAT;
 INVALUE $brand 1='A'  2='B'  3='C'  4='D';
RUN;

DATA rust;
 INFORMAT brand $brand1.;
 INFILE ri;
 INPUT y brand unit;
RUN;

OPTIONS LS=72 NODATE NONUMBER;
TITLE1 'One-Way ANOVA';
TITLE2 'Rust Inhibitor Data';
PROC GLM DATA=rust;
 CLASS brand;
 TITLE3 'One-Way ANOVA Model';
 MODEL y = brand;
 RUN;

 TITLE3 'Brown-Forsythe Test of Homoscedasticity';
 MEANS brand/HOVTEST=BF;
 RUN;

 TITLE3 "Levene's Test (abs Type) of Homoscedasticity";
 MEANS brand/HOVTEST=levene(type=ABS);
 RUN;

 TITLE3 "Bartlett's Test of Homoscedasticity";
 MEANS brand/HOVTEST=bartlett;
 RUN;

 TITLE3 'Pairwise Least Square Mean Differences, Fisher LSD';
 LSMEANS brand/tdiff alpha=.05;  /* LSD */
 RUN;

 * Use OUTPUT statement below to attach residual measures to data;
 OUTPUT OUT=diag P=fits R=residuals RSTUDENT=dsresids;

QUIT;
 TITLE1 'Output Data Set for Diagnosis';
 PROC CONTENTS DATA=diag;run;
* Can run PROC PLOT, PROC GPLOT, etc., to perform residual analysis;

Output Listing

                             One-Way ANOVA
                          Rust Inhibitor Data
                          One-Way ANOVA Model

                           The GLM Procedure
 
Dependent Variable: y   

                                       Sum of
 Source                     DF        Squares    Mean Square   F Value
 Model                       3    15953.46600     5317.82200    866.12
 Error                      36      221.03400        6.13983          
 Corrected Total            39    16174.50000                         

                     Source                 Pr > F
                     Model                  <.0001
                     Error                        
                     Corrected Total              


           R-Square     Coeff Var      Root MSE        y Mean
           0.986334      4.112645      2.477869      60.25000


 Source                     DF      Type I SS    Mean Square   F Value
 BRAND                       3    15953.46600     5317.82200    866.12

                     Source                 Pr > F
                     BRAND                  <.0001


 Source                     DF    Type III SS    Mean Square   F Value
 BRAND                       3    15953.46600     5317.82200    866.12

                     Source                 Pr > F
                     BRAND                  <.0001


                             One-Way ANOVA
                          Rust Inhibitor Data
                Brown-Forsythe Test of Homoscedasticity

                           The GLM Procedure

        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
     BRAND          3      1.8370      0.6123       0.23    0.8775
     Error         36     97.4340      2.7065                     



                             One-Way ANOVA
                          Rust Inhibitor Data
                Brown-Forsythe Test of Homoscedasticity

                           The GLM Procedure

           Level of            --------------y--------------
           BRAND         N             Mean          Std Dev
           A            10       43.1400000       3.00007407
           B            10       89.4400000       2.21820748
           C            10       67.9500000       2.16858889
           D            10       40.4700000       2.43632237



                             One-Way ANOVA
                          Rust Inhibitor Data
              Levene's Test (abs Type) of Homoscedasticity

                           The GLM Procedure

              Levene's Test for Homogeneity of y Variance
             ANOVA of Absolute Deviations from Group Means
 
                           Sum of        Mean
     Source        DF     Squares      Square    F Value    Pr > F
     BRAND          3      2.8053      0.9351       0.42    0.7381
     Error         36     79.6958      2.2138                     



                             One-Way ANOVA
                          Rust Inhibitor Data
              Levene's Test (abs Type) of Homoscedasticity

                           The GLM Procedure

           Level of            --------------y--------------
           BRAND         N             Mean          Std Dev
           A            10       43.1400000       3.00007407
           B            10       89.4400000       2.21820748
           C            10       67.9500000       2.16858889
           D            10       40.4700000       2.43632237



                             One-Way ANOVA
                          Rust Inhibitor Data
                  Bartlett's Test of Homoscedasticity

                           The GLM Procedure

              Bartlett's Test for Homogeneity of y Variance
 
              Source        DF    Chi-Square    Pr > ChiSq
              BRAND          3        1.1990        0.7533



                             One-Way ANOVA
                          Rust Inhibitor Data
                  Bartlett's Test of Homoscedasticity

                           The GLM Procedure

           Level of            --------------y--------------
           BRAND         N             Mean          Std Dev
           A            10       43.1400000       3.00007407
           B            10       89.4400000       2.21820748
           C            10       67.9500000       2.16858889
           D            10       40.4700000       2.43632237



                             One-Way ANOVA
                          Rust Inhibitor Data
           Pairwise Least Square Mean Differences, Fisher LSD

                           The GLM Procedure
                          Least Squares Means

                                              LSMEAN
                   BRAND        y LSMEAN      Number
                   A          43.1400000           1
                   B          89.4400000           2
                   C          67.9500000           3
                   D          40.4700000           4


                  Least Squares Means for Effect BRAND
                t for H0: LSMean(i)=LSMean(j) / Pr > |t|
                                    
                         Dependent Variable: y
 
      i/j              1             2             3             4
         1                    -41.7819      -22.3889       2.40945
                                <.0001        <.0001        0.0212
         2      41.78185                    19.39292       44.1913
                  <.0001                      <.0001        <.0001
         3      22.38894      -19.3929                    24.79839
                  <.0001        <.0001                      <.0001
         4      -2.40945      -44.1913      -24.7984              
                  0.0212        <.0001        <.0001              


NOTE: To ensure overall protection level, only probabilities associated 
      with pre-planned comparisons should be used.



                     Output Data Set for Diagnosis

                         The CONTENTS Procedure

Data Set Name        WORK.DIAG                  Observations          40
Member Type          DATA                       Variables             5 

             

              Alphabetic List of Variables and Attributes
 
                     #    Variable     Type    Len
                     1    BRAND        Char      1
                     5    dsresids     Num       8
                     3    fits         Num       8
                     4    residuals    Num       8
                     2    y            Num       8