SAS Textbook Examples
proc glm data=elemapi2; class collcat; model api00 = meals collcat collcat*meals ; estimate 'slope of meals at collcat=1' meals 1 collcat*meals 1 0 0; estimate 'slope of meals at collcat=2' meals 1 collcat*meals 0 1 0; estimate 'slope of meals at collcat=3' meals 1 collcat*meals 0 0 1; run; quit;
The GLM ProcedureClass Level Information
Class Levels Values
collcat 3 1 2 3Number of observations 400 The GLM Procedure Dependent Variable: api00 api 2000
Sum of Source DF Squares Mean Square F Value Pr > F
Model 5 6629929.872 1325985.974 361.86 <.0001 Error 394 1443742.126 3664.320 Corrected Total 399 8073671.998
R-Square Coeff Var Root MSE api00 Mean
0.821179 9.347054 60.53363 647.6225
Source DF Type I SS Mean Square F Value Pr > F
meals 1 6549825.145 6549825.145 1787.46 <.0001 collcat 2 37126.652 18563.326 5.07 0.0067 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Source DF Type III SS Mean Square F Value Pr > F
meals 1 5389132.969 5389132.969 1470.70 <.0001 collcat 2 14535.351 7267.676 1.98 0.1390 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Standard Parameter Estimate Error t Value Pr > |t|
slope of meals at collcat=1 -4.13839216 0.15484383 -26.73 <.0001 slope of meals at collcat=2 -4.11024157 0.15978196 -25.72 <.0001 slope of meals at collcat=3 -3.32942579 0.20406098 -16.32 <.0001
proc glm data=elemapi2; class collcat; model api00 = meals collcat collcat*meals ; estimate 'slope of 2 v 1 at m=28.4' collcat -1 1 0 collcat*meals -28.4 28.4 0; estimate 'pred values, group 1, m=28.4' intercept 1 meals 28.4 collcat 1 0 0 collcat*meals 28.4 0 0; estimate 'pred values, group 2, m=28.4' intercept 1 meals 28.4 collcat 0 1 0 collcat*meals 0 28.4 0; estimate 'pred values, group 12, m=28.4' intercept 1 meals 28.4 collcat .5 .5 0 collcat*meals 14.2 14.2 0; estimate 'pred values, group 3, m=28.4' intercept 1 meals 28.4 collcat 0 0 1 collcat*meals 0 0 28.4; estimate 'slope of 3 v 12 at m=28.4' collcat -.5 -.5 1 collcat*meals -14.2 -14.2 28.4; run; quit;
The GLM ProcedureClass Level Information
Class Levels Values
collcat 3 1 2 3Number of observations 400 The GLM Procedure Dependent Variable: api00 api 2000 Sum of Source DF Squares Mean Square F Value Pr > F
Model 5 6629929.872 1325985.974 361.86 <.0001 Error 394 1443742.126 3664.320 Corrected Total 399 8073671.998
R-Square Coeff Var Root MSE api00 Mean
0.821179 9.347054 60.53363 647.6225
Source DF Type I SS Mean Square F Value Pr > F
meals 1 6549825.145 6549825.145 1787.46 <.0001 collcat 2 37126.652 18563.326 5.07 0.0067 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Source DF Type III SS Mean Square F Value Pr > F
meals 1 5389132.969 5389132.969 1470.70 <.0001 collcat 2 14535.351 7267.676 1.98 0.1390 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Standard Parameter Estimate Error t Value Pr > |t|
slope of 2 v 1 at m=28.4 11.094401 11.0510713 1.00 0.3160 pred values, group 1, m=28.4 768.602193 8.3633100 91.90 <.0001 pred values, group 2, m=28.4 779.696594 7.2236571 107.94 <.0001 pred values, group 12, m=28.4 774.149393 5.5255356 140.10 <.0001 pred values, group 3, m=28.4 770.295100 7.0505458 109.25 <.0001 slope of 3 v 12 at m=28.4 -3.854294 8.9577754 -0.43 0.6672
proc glm data=elemapi2; class collcat; model api00 = meals collcat collcat*meals ; estimate 'slope of 2 v 1 at m=92.2' collcat -1 1 0 collcat*meals -92.2 92.2 0; estimate 'slope of 3 v 12 at m=92.2' collcat -.5 -.5 1 collcat*meals -46.1 -46.1 92.2; run; quit;
The GLM ProcedureClass Level Information
Class Levels Values
collcat 3 1 2 3Number of observations 400 The GLM Procedure Dependent Variable: api00 api 2000 Sum of Source DF Squares Mean Square F Value Pr > F
Model 5 6629929.872 1325985.974 361.86 <.0001 Error 394 1443742.126 3664.320 Corrected Total 399 8073671.998
R-Square Coeff Var Root MSE api00 Mean
0.821179 9.347054 60.53363 647.6225
Source DF Type I SS Mean Square F Value Pr > F
meals 1 6549825.145 6549825.145 1787.46 <.0001 collcat 2 37126.652 18563.326 5.07 0.0067 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Source DF Type III SS Mean Square F Value Pr > F
meals 1 5389132.969 5389132.969 1470.70 <.0001 collcat 2 14535.351 7267.676 1.98 0.1390 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Standard Parameter Estimate Error t Value Pr > |t|
slope of 2 v 1 at m=92.2 12.8904091 9.7310376 1.32 0.1860 slope of 3 v 12 at m=92.2 46.8597567 10.8676142 4.31 <.0001
proc glm data=elemapi2; class collcat; model api00 = meals collcat collcat*meals ; estimate 'slope of 2 v 1 at m=92.2' collcat -1 1 0 collcat*meals -92.2 92.2 0; estimate 'slope of 3 v 12 at m=92.2' collcat -.5 -.5 1 collcat*meals -46.1 -46.1 92.2; run; quit;
The GLM ProcedureClass Level Information
Class Levels Values
collcat 3 1 2 3Number of observations 400 The GLM Procedure Dependent Variable: api00 api 2000 Sum of Source DF Squares Mean Square F Value Pr > F
Model 5 6629929.872 1325985.974 361.86 <.0001 Error 394 1443742.126 3664.320 Corrected Total 399 8073671.998
R-Square Coeff Var Root MSE api00 Mean
0.821179 9.347054 60.53363 647.6225
Source DF Type I SS Mean Square F Value Pr > F
meals 1 6549825.145 6549825.145 1787.46 <.0001 collcat 2 37126.652 18563.326 5.07 0.0067 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Source DF Type III SS Mean Square F Value Pr > F
meals 1 5389132.969 5389132.969 1470.70 <.0001 collcat 2 14535.351 7267.676 1.98 0.1390 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Standard Parameter Estimate Error t Value Pr > |t|
slope of 2 v 1 at m=92.2 12.8904091 9.7310376 1.32 0.1860 slope of 3 v 12 at m=92.2 46.8597567 10.8676142 4.31 <.0001
proc glm data=elemapi2; class collcat; model api00 = meals collcat collcat*meals ; estimate 'slope of 2 v 1 at m=28.4' collcat -1 1 0 collcat*meals -28.4 28.4 0; estimate 'pred values, group 1, m=28.4' intercept 1 meals 28.4 collcat 1 0 0 collcat*meals 28.4 0 0; estimate 'pred values, group 2, m=28.4' intercept 1 meals 28.4 collcat 0 1 0 collcat*meals 0 28.4 0; estimate 'slope of 3 v 12 at m=28.4' collcat -.5 -.5 1 collcat*meals -14.2 -14.2 28.4; estimate 'pred values, group 12, m=28.4' intercept 1 meals 28.4 collcat .5 .5 0 collcat*meals 14.2 14.2 0; estimate 'pred values, group 3, m=28.4' intercept 1 meals 28.4 collcat 0 0 1 collcat*meals 0 0 28.4; estimate 'slope of 2 v 1 at m=60.3' collcat -1 1 0 collcat*meals -60.3 60.3 0; estimate 'slope of 3 v 12 at m=60.3' collcat -.5 -.5 1 collcat*meals -30.15 -30.15 60.3; estimate 'slope of 2 v 1 at m=92.2' collcat -1 1 0 collcat*meals -92.2 92.2 0; estimate 'slope of 3 v 12 at m=92.2' collcat -.5 -.5 1 collcat*meals -46.1 -46.1 92.2; estimate 'slope of 2 v 1 at m=60.3 v m=28.4' collcat*meals -31.9 31.9 0; estimate 'slope of 3 v 12 at m=60.3 v m=28.4' collcat*meals -15.95 -15.95 31.9 ; run; quit;
The GLM ProcedureClass Level Information
Class Levels Values
collcat 3 1 2 3Number of observations 400 The GLM Procedure Dependent Variable: api00 api 2000 Sum of Source DF Squares Mean Square F Value Pr > F
Model 5 6629929.872 1325985.974 361.86 <.0001 Error 394 1443742.126 3664.320 Corrected Total 399 8073671.998
R-Square Coeff Var Root MSE api00 Mean
0.821179 9.347054 60.53363 647.6225
Source DF Type I SS Mean Square F Value Pr > F
meals 1 6549825.145 6549825.145 1787.46 <.0001 collcat 2 37126.652 18563.326 5.07 0.0067 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Source DF Type III SS Mean Square F Value Pr > F
meals 1 5389132.969 5389132.969 1470.70 <.0001 collcat 2 14535.351 7267.676 1.98 0.1390 meals*collcat 2 42978.076 21489.038 5.86 0.0031
Standard Parameter Estimate Error t Value Pr > |t|
slope of 2 v 1 at m=28.4 11.094401 11.0510713 1.00 0.3160 pred values, group 1, m=28.4 768.602193 8.3633100 91.90 <.0001 pred values, group 2, m=28.4 779.696594 7.2236571 107.94 <.0001 slope of 3 v 12 at m=28.4 -3.854294 8.9577754 -0.43 0.6672 pred values, group 12, m=28.4 774.149393 5.5255356 140.10 <.0001 pred values, group 3, m=28.4 770.295100 7.0505458 109.25 <.0001 slope of 2 v 1 at m=60.3 11.992405 7.6178035 1.57 0.1162 slope of 3 v 12 at m=60.3 21.502731 6.6486489 3.23 0.0013 slope of 2 v 1 at m=92.2 12.890409 9.7310376 1.32 0.1860 slope of 3 v 12 at m=92.2 46.859757 10.8676142 4.31 <.0001 slope of 2 v 1 at m=60.3 v m=28.4 0.898004 7.0977957 0.13 0.8994 slope of 3 v 12 at m=60.3 v m=28.4 25.357025 7.4140986 3.42 0.0007