* mreg.sas, for test 2, fall 97; options ls=72; ; * input the raw data; data A; input y x1 x2 x3 x4; lines; 57.5 78 48.2 2.75 29.5 52.8 69 45.5 2.15 26.3 61.3 77 46.3 4.41 32.2 67.0 88 49.0 5.52 36.5 53.5 67 43.0 3.21 27.2 62.7 80 48.0 4.32 27.7 56.2 74 48.0 2.31 28.3 68.5 94 53.0 4.30 30.3 69.2 102 58.0 3.71 28.7 ; * input the raw data, plus one 'missing' observation; proc corr nosimple; var x1 x2 x3 x4; ; data B; input y x1 x2 x3 x4; lines; 57.5 78 48.2 2.75 29.5 52.8 69 45.5 2.15 26.3 61.3 77 46.3 4.41 32.2 67.0 88 49.0 5.52 36.5 53.5 67 43.0 3.21 27.2 62.7 80 48.0 4.32 27.7 56.2 74 48.0 2.31 28.3 68.5 94 53.0 4.30 30.3 69.2 102 58.0 3.71 28.7 . 100 55.0 4.40 30.0 ; proc glm; model y = x1 x2 x3 x4; output out=C p=yhat L95M=L95M U95M=U95M STDP=STDM; proc print; ; proc reg data=A; model y = x3; output out=D p=yhat r=e; ; proc plot; plot e*x1 e*x2 e*x4 / vpos=20 vref=0; The SAS System 1 Correlation Analysis 4 'VAR' Variables: X1 X2 X3 X4 Pearson Correlation Coefficients / Prob > |R| under Ho: Rho=0 / N = 9 X1 X2 X3 X4 X1 1.00000 0.95227 0.53402 0.38999 0.0 0.0001 0.1386 0.2995 X2 0.95227 1.00000 0.26267 0.15491 0.0001 0.0 0.4947 0.6907 X3 0.53402 0.26267 1.00000 0.78447 0.1386 0.4947 0.0 0.0123 X4 0.38999 0.15491 0.78447 1.00000 0.2995 0.6907 0.0123 0.0 The SAS System 2 General Linear Models Procedure Number of observations in data set = 10 NOTE: Due to missing values, only 9 observations can be used in this analysis. The SAS System 3 General Linear Models Procedure Dependent Variable: Y Sum of Mean Source DF Squares Square F Value Pr > F Model 4 318.27442 79.56860 107.32 0.0003 Error 4 2.96558 0.74140 Corrected Total 8 321.24000 R-Square C.V. Root MSE Y Mean 0.990768 1.412318 0.8610 60.967 Source DF Type I SS Mean Square F Value Pr > F X1 1 288.14682 288.14682 388.65 0.0001 X2 1 23.87033 23.87033 32.20 0.0048 X3 1 6.23312 6.23312 8.41 0.0441 X4 1 0.02415 0.02415 0.03 0.8656 Source DF Type III SS Mean Square F Value Pr > F X1 1 0.0643659 0.0643659 0.09 0.7829 X2 1 0.6334114 0.6334114 0.85 0.4076 X3 1 6.2522722 6.2522722 8.43 0.0439 X4 1 0.0241479 0.0241479 0.03 0.8656 T for H0: Pr > |T| Std Error of Parameter Estimate Parameter=0 Estimate INTERCEPT 7.147532400 0.43 0.6865 16.45961128 X1 0.100094469 0.29 0.7829 0.33970898 X2 0.726417378 0.92 0.4076 0.78590156 X3 3.075836985 2.90 0.0439 1.05917874 X4 -0.030042148 -0.18 0.8656 0.16646232 The SAS System 4 OBS Y X1 X2 X3 X4 YHAT L95M U95M STDM 1 57.5 78 48.2 2.75 29.5 57.5405 56.0124 59.0686 0.55038 2 52.8 69 45.5 2.15 26.3 52.9290 51.4916 54.3663 0.51769 3 61.3 77 46.3 4.41 32.2 61.0850 59.6003 62.5697 0.53475 4 67.0 88 49.0 5.52 36.5 67.4324 65.3879 69.4768 0.73635 5 53.5 67 43.0 3.21 27.2 54.1461 52.3817 55.9105 0.63547 6 62.7 80 48.0 4.32 27.7 62.4786 60.4773 64.4798 0.72080 7 56.2 74 48.0 2.31 28.3 55.6775 53.7855 57.5696 0.68145 8 68.5 94 53.0 4.30 30.3 67.3724 65.6586 69.0861 0.61725 9 69.2 102 58.0 3.71 28.7 70.0385 67.9999 72.0771 0.73426 10 . 100 55.0 4.40 30.0 69.7424 66.9717 72.5130 0.99791 The SAS System 5 Model: MODEL1 Dependent Variable: Y Analysis of Variance Sum of Mean Source DF Squares Square F Value Prob>F Model 1 186.10652 186.10652 9.640 0.0172 Error 7 135.13348 19.30478 C Total 8 321.24000 Root MSE 4.39372 R-square 0.5793 Dep Mean 60.96667 Adj R-sq 0.5192 C.V. 7.20676 Parameter Estimates Parameter Standard T for H0: Variable DF Estimate Error Parameter=0 Prob > |T| INTERCEP 1 45.298495 5.25449879 8.621 0.0001 X3 1 4.314980 1.38973002 3.105 0.0172 The SAS System 6 Plot of E*X1. Legend: A = 1 obs, B = 2 obs, etc. | | 10 + | | A | R 5 + A e | s | i | A d 0 +------------------------A---------------------------------------- u | A A a | A A l | -5 + | A | | -10 + | ---+-----------+-----------+-----------+-----------+-----------+-- 60 70 80 90 100 110 X1 The SAS System 7 Plot of E*X2. Legend: A = 1 obs, B = 2 obs, etc. | | 10 + | | A | R 5 + A e | s | i | A d 0 +---------------------A------------------------------------------- u | A A a | A A l | -5 + | A | | -10 + | -+--------+--------+--------+--------+--------+--------+--------+- 42.5 45.0 47.5 50.0 52.5 55.0 57.5 60.0 X2 The SAS System 8 Plot of E*X4. Legend: A = 1 obs, B = 2 obs, etc. | | 10 + | | A | R 5 + A e | s | i | A d 0 +--------------------A-------------------------------------------- u | A A a | A A l | -5 + | A | | -10 + | ---+---------+---------+---------+---------+---------+---------+-- 26 28 30 32 34 36 38 X4