/* One-Way ANOVA with factor effects parameterization using PROC REG*/ /* Pairwise comparisons and multiple comparison adjustments using PTOC GLM */ OPTIONS LS=75 PS=55 PAGENO=1 NODATE; DATA one; INPUT sales package $ x1 x2 x3; DATALINES; 11 3color-cartoon 1 0 0 17 3color-cartoon 1 0 0 16 3color-cartoon 1 0 0 14 3color-cartoon 1 0 0 15 3color-cartoon 1 0 0 12 3color-real 0 1 0 10 3color-real 0 1 0 15 3color-real 0 1 0 19 3color-real 0 1 0 11 3color-real 0 1 0 23 5color-cartoon 0 0 1 20 5color-cartoon 0 0 1 18 5color-cartoon 0 0 1 17 5color-cartoon 0 0 1 27 5color-real -1 -1 -1 33 5color-real -1 -1 -1 22 5color-real -1 -1 -1 26 5color-real -1 -1 -1 28 5color-real -1 -1 -1 ; PROC REG DATA=one; TITLE3 'PROC REG with factor effects parameterization'; MODEL sales = x1 x2 x3 / P; RUN; PROC GLM DATA=one; TITLE 'Inference for Factor Level Means'; CLASS package; MODEL sales = package; MEANS package / T; CONTRAST 'mu1-mu2' package 1 -1 0 0; CONTRAST '3color-5color' package 1 1 -1 -1; ESTIMATE 'mu1-mu2' package 1 -1 0 0; ESTIMATE '3color-5color' package .5 .5 -.5 -.5; RUN; PROC GLM DATA=one; TITLE 'Multiple Comparisons'; CLASS package; MODEL sales = package; MEANS package / T TUKEY SCHEFFE BON; RUN; QUIT; ********************************************************************** The SAS System 1 PROC REG with factor effects parameterization The REG Procedure Model: MODEL1 Dependent Variable: sales Number of Observations Read 19 Number of Observations Used 19 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model 3 588.22105 196.07368 18.59 <.0001 Error 15 158.20000 10.54667 Corrected Total 18 746.42105 Root MSE 3.24756 R-Square 0.7881 Dependent Mean 18.63158 Adj R-Sq 0.7457 Coeff Var 17.43042 Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr > |t| Intercept 1 18.67500 0.74853 24.95 <.0001 x1 1 -4.07500 1.27081 -3.21 0.0059 x2 1 -5.27500 1.27081 -4.15 0.0009 x3 1 0.82500 1.37063 0.60 0.5562 The SAS System 2 PROC REG with factor effects parameterization The REG Procedure Model: MODEL1 Dependent Variable: sales Output Statistics Dependent Predicted Obs Variable Value Residual 1 11.0000 14.6000 -3.6000 2 17.0000 14.6000 2.4000 3 16.0000 14.6000 1.4000 4 14.0000 14.6000 -0.6000 5 15.0000 14.6000 0.4000 6 12.0000 13.4000 -1.4000 7 10.0000 13.4000 -3.4000 8 15.0000 13.4000 1.6000 9 19.0000 13.4000 5.6000 10 11.0000 13.4000 -2.4000 11 23.0000 19.5000 3.5000 12 20.0000 19.5000 0.5000 13 18.0000 19.5000 -1.5000 14 17.0000 19.5000 -2.5000 15 27.0000 27.2000 -0.2000 16 33.0000 27.2000 5.8000 17 22.0000 27.2000 -5.2000 18 26.0000 27.2000 -1.2000 19 28.0000 27.2000 0.8000 Sum of Residuals 0 Sum of Squared Residuals 158.20000 Predicted Residual SS (PRESS) 251.70833 Inference for Factor Level Means 3 The GLM Procedure Class Level Information Class Levels Values package 4 3color-c 3color-r 5color-c 5color-r Number of Observations Read 19 Number of Observations Used 19 Inference for Factor Level Means 4 The GLM Procedure Dependent Variable: sales Sum of Source DF Squares Mean Square F Value Pr > F Model 3 588.2210526 196.0736842 18.59 <.0001 Error 15 158.2000000 10.5466667 Corrected Total 18 746.4210526 R-Square Coeff Var Root MSE sales Mean 0.788055 17.43042 3.247563 18.63158 Source DF Type I SS Mean Square F Value Pr > F package 3 588.2210526 196.0736842 18.59 <.0001 Source DF Type III SS Mean Square F Value Pr > F package 3 588.2210526 196.0736842 18.59 <.0001 Inference for Factor Level Means 5 The GLM Procedure t Tests (LSD) for sales NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 15 Error Mean Square 10.54667 Critical Value of t 2.13145 Comparisons significant at the 0.05 level are indicated by ***. Difference package Between 95% Confidence Comparison Means Limits 5color-r - 5color-c 7.700 3.057 12.343 *** 5color-r - 3color-c 12.600 8.222 16.978 *** 5color-r - 3color-r 13.800 9.422 18.178 *** 5color-c - 5color-r -7.700 -12.343 -3.057 *** 5color-c - 3color-c 4.900 0.257 9.543 *** 5color-c - 3color-r 6.100 1.457 10.743 *** 3color-c - 5color-r -12.600 -16.978 -8.222 *** 3color-c - 5color-c -4.900 -9.543 -0.257 *** 3color-c - 3color-r 1.200 -3.178 5.578 3color-r - 5color-r -13.800 -18.178 -9.422 *** 3color-r - 5color-c -6.100 -10.743 -1.457 *** 3color-r - 3color-c -1.200 -5.578 3.178 Inference for Factor Level Means 6 The GLM Procedure Dependent Variable: sales Contrast DF Contrast SS Mean Square F Value Pr > F mu1-mu2 1 3.6000000 3.6000000 0.34 0.5677 3color-5color 1 411.4000000 411.4000000 39.01 <.0001 Standard Parameter Estimate Error t Value Pr > |t| mu1-mu2 1.20000000 2.05393930 0.58 0.5677 3color-5color -9.35000000 1.49705266 -6.25 <.0001 Multiple Comparisons 7 The GLM Procedure Class Level Information Class Levels Values package 4 3color-c 3color-r 5color-c 5color-r Number of Observations Read 19 Number of Observations Used 19 Multiple Comparisons 8 The GLM Procedure Dependent Variable: sales Sum of Source DF Squares Mean Square F Value Pr > F Model 3 588.2210526 196.0736842 18.59 <.0001 Error 15 158.2000000 10.5466667 Corrected Total 18 746.4210526 R-Square Coeff Var Root MSE sales Mean 0.788055 17.43042 3.247563 18.63158 Source DF Type I SS Mean Square F Value Pr > F package 3 588.2210526 196.0736842 18.59 <.0001 Source DF Type III SS Mean Square F Value Pr > F package 3 588.2210526 196.0736842 18.59 <.0001 Multiple Comparisons 9 The GLM Procedure t Tests (LSD) for sales NOTE: This test controls the Type I comparisonwise error rate, not the experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 15 Error Mean Square 10.54667 Critical Value of t 2.13145 Comparisons significant at the 0.05 level are indicated by ***. Difference package Between 95% Confidence Comparison Means Limits 5color-r - 5color-c 7.700 3.057 12.343 *** 5color-r - 3color-c 12.600 8.222 16.978 *** 5color-r - 3color-r 13.800 9.422 18.178 *** 5color-c - 5color-r -7.700 -12.343 -3.057 *** 5color-c - 3color-c 4.900 0.257 9.543 *** 5color-c - 3color-r 6.100 1.457 10.743 *** 3color-c - 5color-r -12.600 -16.978 -8.222 *** 3color-c - 5color-c -4.900 -9.543 -0.257 *** 3color-c - 3color-r 1.200 -3.178 5.578 3color-r - 5color-r -13.800 -18.178 -9.422 *** 3color-r - 5color-c -6.100 -10.743 -1.457 *** 3color-r - 3color-c -1.200 -5.578 3.178 Multiple Comparisons 10 The GLM Procedure Tukey's Studentized Range (HSD) Test for sales NOTE: This test controls the Type I experimentwise error rate. Alpha 0.05 Error Degrees of Freedom 15 Error Mean Square 10.54667 Critical Value of Studentized Range 4.07588 Comparisons significant at the 0.05 level are indicated by ***. Difference package Between Simultaneous 95% Comparison Means Confidence Limits 5color-r - 5color-c 7.700 1.421 13.979 *** 5color-r - 3color-c 12.600 6.680 18.520 *** 5color-r - 3color-r 13.800 7.880 19.720 *** 5color-c - 5color-r -7.700 -13.979 -1.421 *** 5color-c - 3color-c 4.900 -1.379 11.179 5color-c - 3color-r 6.100 -0.179 12.379 3color-c - 5color-r -12.600 -18.520 -6.680 *** 3color-c - 5color-c -4.900 -11.179 1.379 3color-c - 3color-r 1.200 -4.720 7.120 3color-r - 5color-r -13.800 -19.720 -7.880 *** 3color-r - 5color-c -6.100 -12.379 0.179 3color-r - 3color-c -1.200 -7.120 4.720 Multiple Comparisons 11 The GLM Procedure Bonferroni (Dunn) t Tests for sales NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than Tukey's for all pairwise comparisons. Alpha 0.05 Error Degrees of Freedom 15 Error Mean Square 10.54667 Critical Value of t 3.03628 Comparisons significant at the 0.05 level are indicated by ***. Difference package Between Simultaneous 95% Comparison Means Confidence Limits 5color-r - 5color-c 7.700 1.085 14.315 *** 5color-r - 3color-c 12.600 6.364 18.836 *** 5color-r - 3color-r 13.800 7.564 20.036 *** 5color-c - 5color-r -7.700 -14.315 -1.085 *** 5color-c - 3color-c 4.900 -1.715 11.515 5color-c - 3color-r 6.100 -0.515 12.715 3color-c - 5color-r -12.600 -18.836 -6.364 *** 3color-c - 5color-c -4.900 -11.515 1.715 3color-c - 3color-r 1.200 -5.036 7.436 3color-r - 5color-r -13.800 -20.036 -7.564 *** 3color-r - 5color-c -6.100 -12.715 0.515 3color-r - 3color-c -1.200 -7.436 5.036 Multiple Comparisons 12 The GLM Procedure Scheffe's Test for sales NOTE: This test controls the Type I experimentwise error rate, but it generally has a higher Type II error rate than Tukey's for all pairwise comparisons. Alpha 0.05 Error Degrees of Freedom 15 Error Mean Square 10.54667 Critical Value of F 3.28738 Comparisons significant at the 0.05 level are indicated by ***. Difference package Between Simultaneous 95% Comparison Means Confidence Limits 5color-r - 5color-c 7.700 0.859 14.541 *** 5color-r - 3color-c 12.600 6.150 19.050 *** 5color-r - 3color-r 13.800 7.350 20.250 *** 5color-c - 5color-r -7.700 -14.541 -0.859 *** 5color-c - 3color-c 4.900 -1.941 11.741 5color-c - 3color-r 6.100 -0.741 12.941 3color-c - 5color-r -12.600 -19.050 -6.150 *** 3color-c - 5color-c -4.900 -11.741 1.941 3color-c - 3color-r 1.200 -5.250 7.650 3color-r - 5color-r -13.800 -20.250 -7.350 *** 3color-r - 5color-c -6.100 -12.941 0.741 3color-r - 3color-c -1.200 -7.650 5.250