Handout: EXTRA SUMS OF SQUARES SAS code *************************************************************************************** PROC REG DATA=one; TITLE2 'Type 1 SS (SS to add) and Type 2 SS (SS to remove)'; MODEL y=x1 x2 x3 / SS1 SS2; RUN; PROC REG DATA=one; TITLE2 'Type 1 SS (SS to add) and Type 2 SS (SS to remove)'; MODEL y=x2 x1 x3 / SS1 SS2; RUN; *************************************************************************************** Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model 3 396.98461 132.32820 21.52 <.0001 Error 16 98.40489 6.15031 Corrected Total 19 495.38950 Root MSE 2.47998 R-Square 0.8014 Dependent Mean 20.19500 Adj R-Sq 0.7641 Coeff Var 12.28017 Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr > |t| Type I SS Type II SS Intercept 1 117.08469 99.78240 1.17 0.2578 8156.76050 8.46816 x1 1 4.33409 3.01551 1.44 0.1699 352.26980 12.70489 x2 1 -2.85685 2.58202 -1.11 0.2849 33.16891 7.52928 x3 1 -2.18606 1.59550 -1.37 0.1896 11.54590 11.54590 --------------------------------------------------------------------------------------- Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model 3 396.98461 132.32820 21.52 <.0001 Error 16 98.40489 6.15031 Corrected Total 19 495.38950 Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr > |t| Type I SS Type II SS Intercept 1 117.08469 99.78240 1.17 0.2578 8156.76050 8.46816 x2 1 -2.85685 2.58202 -1.11 0.2849 381.96582 7.52928 x1 1 4.33409 3.01551 1.44 0.1699 3.47289 12.70489 x3 1 -2.18606 1.59550 -1.37 0.1896 11.54590 11.54590 ******************************************************************************* DATA bodyfat1; INPUT x1 x2 x3 y; DATALINES; 19.5 43.1 29.1 11.9 24.7 49.8 28.2 22.8 30.7 51.9 37.0 18.7 29.8 54.3 31.1 20.1 19.1 42.2 30.9 12.9 25.6 53.9 23.7 21.7 31.4 58.5 27.6 27.1 27.9 52.1 30.6 25.4 22.1 49.9 23.2 21.3 25.5 53.5 24.8 19.3 31.1 56.6 30.0 25.4 30.4 56.7 28.3 27.2 18.7 46.5 23.0 11.7 19.7 44.2 28.6 17.8 14.6 42.7 21.3 12.8 29.5 54.4 30.1 23.9 27.7 55.3 25.7 22.6 30.2 58.6 24.6 25.4 22.7 48.2 27.1 14.8 25.2 51.0 27.5 21.1 ; PROC REG DATA=bodyfat1; MODEL y=x1 x2 x3 / SELECTION=RSQUARE SSE; RUN; QUIT; ******************************************************************************* The SAS System 1 The REG Procedure Model: MODEL1 Dependent Variable: y R-Square Selection Method Number of Observations Read 20 Number of Observations Used 20 Number in Model R-Square SSE Variables in Model 1 0.7710 113.42368 x2 1 0.7111 143.11970 x1 1 0.0203 485.33790 x3 ---------------------------------------------------------- 2 0.7862 105.93417 x1 x3 2 0.7781 109.95079 x1 x2 2 0.7757 111.10978 x2 x3 ---------------------------------------------------------- 3 0.8014 98.40489 x1 x2 x3 SAS code ******************************************************************************* PROC REG DATA=bodyfat1; MODEL y= x1; MODEL y= x1 x2; MODEL y= x1 x2 x3; MODEL y= x2 x3; MODEL y= x1 x3; RUN; ******************************************************************************* Intercept 1 -1.49610 3.31923 -0.45 0.6576 x1 1 0.85719 0.12878 6.66 <.0001 SSR=352.26980 SSE=143.11970 ******************************************************************************* Intercept 1 -19.17425 8.36064 -2.29 0.0348 x1 1 0.22235 0.30344 0.73 0.4737 x2 1 0.65942 0.29119 2.26 0.0369 SSR=385.43871 SSE=109.95079 ******************************************************************************* Intercept 1 117.08469 99.78240 1.17 0.2578 x1 1 4.33409 3.01551 1.44 0.1699 x2 1 -2.85685 2.58202 -1.11 0.2849 x3 1 -2.18606 1.59550 -1.37 0.1896 SSR=396.98461 SSE= 98.40489 ******************************************************************************* Intercept 1 -25.99695 6.99732 -3.72 0.0017 x2 1 0.85088 0.11245 7.57 <.0001 x3 1 0.09603 0.16139 0.60 0.5597 SSR=384.27972 SSE=111.10978 ******************************************************************************* Intercept 1 6.79163 4.48829 1.51 0.1486 x1 1 1.00058 0.12823 7.80 <.0001 x3 1 -0.43144 0.17662 -2.44 0.0258 SSR=389.45533 SSE=105.93417