A REGRESSION on 5 covariates - YOURNAME 1 PROC REG for AppleTaste on 5 covariates 22:37 Monday, October 17, 2005 The MODEL TEST is highly significant, but NO COVARIATES are significant in the Param.Est. table. The REG Procedure Model: MODEL1 Dependent Variable: yy AppleTaste Number of Observations Read 14 Number of Observations Used 14 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model 5 3577641 715528 11.65 0.0016 Error 8 491317 61415 Corrected Total 13 4068957 Root MSE 247.81967 R-Square 0.8793 Dependent Mean 2195.42857 Adj R-Sq 0.8038 Coeff Var 11.28799 Parameter Estimates Parameter Standard Variable Label DF Estimate Error t Value Pr > |t| Intercept Intercept 1 299.64546 988.08291 0.30 0.7694 nat Sodium 1 -10.77226 76.56324 -0.14 0.8916 kk Potassium 1 43.61828 60.00005 0.73 0.4880 pp Phosphorus 1 0.34494 0.74392 0.46 0.6552 shade Shade 1 -179.09980 1800.82748 -0.10 0.9232 water Water 1 1.75238 3.52645 0.50 0.6326 A REGRESSION on 5 covariates - YOURNAME 2 PROC REG for AppleTaste on 5 covariates 22:37 Monday, October 17, 2005 The MODEL TEST is highly significant, but NO COVARIATES are significant in the Param.Est. table. The REG Procedure Model: MODEL1 Dependent Variable: yy AppleTaste Output Statistics Dependent Predicted Std Error Std Error Student Obs Variable Value Mean Predict Residual Residual Residual 1 2876 2545 162.2851 330.9954 187.3 1.767 2 2078 2054 134.5014 24.3789 208.1 0.117 3 3052 2921 185.3258 131.4174 164.5 0.799 4 2265 1962 121.7668 303.4113 215.8 1.406 5 940.0000 1121 209.0136 -181.2443 133.1 -1.361 6 2815 2768 163.4178 47.4069 186.3 0.254 7 2661 2735 148.6937 -73.6539 198.3 -0.372 8 2181 2279 143.1761 -97.7067 202.3 -0.483 9 2052 1952 151.6323 99.5374 196.0 0.508 10 2064 2314 136.7896 -250.1510 206.6 -1.211 11 1551 1348 137.5019 202.6941 206.2 0.983 12 2338 2587 135.9839 -248.8729 207.2 -1.201 13 1753 1848 219.8169 -95.4855 114.4 -0.834 14 2110 2303 185.6468 -192.7272 164.2 -1.174 Output Statistics Cook's Obs -2-1 0 1 2 D 1 | |*** | 0.391 2 | | | 0.001 3 | |* | 0.135 4 | |** | 0.105 5 | **| | 0.761 6 | | | 0.008 7 | | | 0.013 8 | | | 0.019 9 | |* | 0.026 10 | **| | 0.107 11 | |* | 0.072 12 | **| | 0.104 13 | *| | 0.428 14 | **| | 0.294 Sum of Residuals 0 Sum of Squared Residuals 491317 Predicted Residual SS (PRESS) 1782663 A REGRESSION on 5 covariates - YOURNAME 3 NOW USE MATRIX THEORY (SAS's PROC IML) to do the same analysis (PROC IML IS SAS's MATRIX LANGUAGE) 22:37 Monday, October 17, 2005 Design Matrix (X) XX 1.00 20.00 38.00 2488.00 2.42 216.00 1.00 11.10 13.00 2998.00 1.62 321.00 1.00 19.80 31.00 3835.00 2.79 376.00 1.00 13.90 19.00 2360.00 1.65 265.00 1.00 17.00 24.00 233.00 0.86 18.00 1.00 16.90 26.00 3922.00 2.70 369.00 1.00 11.60 16.00 4343.00 2.40 453.00 1.00 14.30 22.00 3110.00 2.05 267.00 1.00 10.50 13.00 2869.00 1.63 286.00 1.00 18.20 31.00 2335.00 2.17 252.00 1.00 8.30 8.00 1784.00 0.84 185.00 1.00 20.40 36.00 2601.00 2.47 275.00 1.00 8.70 18.00 2124.00 1.27 201.00 1.00 7.50 4.00 4408.00 1.85 411.00 The matrix X'X: XPX 14.00 198.20 299.00 39410.00 26.72 3895.00 198.20 3080.60 4817.90 548897.30 400.86 54192.50 299.00 4817.90 7757.00 816169.00 619.56 80392.00 39410.00 548897.30 816169.00 126998178.0 81578.58 12509168.00 26.72 400.86 619.56 81578.58 56.19 8038.65 3895.00 54192.50 80392.00 12509168.00 8038.65 1238753.00 (X'X)^{-1} and X'Y: XPXINV XPY 15.8970 -1.0565 -0.7765 -0.0104 27.1476 -0.0247 30736.0 -1.0565 0.0954 0.0344 0.0007 -1.6924 0.0011 448863.7 -0.7765 0.0344 0.0586 0.0006 -1.6280 0.0017 687487.0 -0.0104 0.0007 0.0006 0.0000 -0.0199 0.0000 92613237 27.1476 -1.6924 -1.6280 -0.0199 52.8047 -0.0475 62876.1 -0.0247 0.0011 0.0017 0.0000 -0.0475 0.0002 9135894.0 Regression Results using Proc IML: Recall BETA = (X'X)^{-1}X'Y The following should be IDENTICAL with the Proc REG output: The estimated regression parameters in Proc IML are VARNAMES BETA Intercept 299.645457 Sodium -10.772260 Potassium 43.618276 Phosphorus 0.344943 Shade -179.099800 Water 1.752377 A REGRESSION on 5 covariates - YOURNAME 4 NOW USE MATRIX THEORY (SAS's PROC IML) to do the same analysis (PROC IML IS SAS's MATRIX LANGUAGE) 22:37 Monday, October 17, 2005 Parameter estimate table using Proc IML VARNAMES BETA STDB TT PROBT Intercept 299.645457 988.082906 0.303259 0.769429 Sodium -10.772260 76.563241 -0.140698 0.891587 Potassium 43.618276 60.000052 0.726971 0.487969 Phosphorus 0.344943 0.743922 0.463682 0.655231 Shade -179.099800 1800.827477 -0.099454 0.923225 Water 1.752377 3.526446 0.496925 0.632609 Studentized Residuals from PROC IML: Y, Yfit, Residuals, ResStdev, and Studentized residuals: YY YFIT RESID RESSTDEV STUDTRES 2876 2545.00 330.995 187.292 1.76727 2078 2053.62 24.379 208.144 0.11713 3052 2920.58 131.417 164.526 0.79876 2265 1961.59 303.411 215.841 1.40571 940 1121.24 -181.244 133.146 -1.36124 2815 2767.59 47.407 186.304 0.25446 2661 2734.65 -73.654 198.254 -0.37151 2181 2278.71 -97.707 202.275 -0.48304 2052 1952.46 99.537 196.016 0.50780 2064 2314.15 -250.151 206.647 -1.21052 1551 1348.31 202.694 206.174 0.98312 2338 2586.87 -248.873 207.179 -1.20125 1753 1848.49 -95.485 114.434 -0.83442 2110 2302.73 -192.727 164.164 -1.17399 Model ANOVA results from Proc IML: RSQUARE DFMOD DFERROR FSTAT PFSTAT ROOTMSE 0.87925 5 8 11.6508 0.0016473 247.82 THE ANOVA TABLE: ROWNAMES SSTAB DEGFREE SSMOD 3577640.728 5 SSE 491316.700 8 SUM 4068957.429 13 SSTOT 4068957.429 13 A REGRESSION on 5 covariates - YOURNAME 5 NOW USE MATRIX THEORY (SAS's PROC IML) to do the same analysis (PROC IML IS SAS's MATRIX LANGUAGE) 22:37 Monday, October 17, 2005 THE CORRELATION MATRIX OF THE COLUMNS OF X IS CORR 1.0000 0.9531 -0.1361 0.5980 -0.1455 0.9531 1.0000 -0.1719 0.5796 -0.1916 -0.1361 -0.1719 1.0000 0.6968 0.9788 0.5980 0.5796 0.6968 1.0000 0.6740 -0.1455 -0.1916 0.9788 0.6740 1.0000 THE EIGENVALUES AND EIGENVECTORS OF CORR ARE EGVALS EGVECS 2.649956 0.3001 0.5678 0.7375 -0.1195 0.1713 2.277384 0.2807 0.5819 -0.6055 0.2722 0.3765 0.049312 0.4852 -0.4021 -0.1001 -0.5737 0.5135 0.021302 0.6070 0.0939 -0.1768 -0.1889 -0.7455 0.002046 0.4767 -0.4105 0.2193 0.7394 0.0971 (The columns of Egvecs are the eigenvectors of Corr) A REGRESSION on 5 covariates - YOURNAME 6 BACK TO REGULAR SAS 22:37 Monday, October 17, 2005 Using PROC PRINT to display the PARAMETER ESTIMATE TABLE IMPORTED from PROC IML Obs VARNAMES BETA STDB TT PROBT 1 Intercept 299.645 988.08 0.30326 0.76943 2 Sodium -10.772 76.56 -0.14070 0.89159 3 Potassium 43.618 60.00 0.72697 0.48797 4 Phosphorus 0.345 0.74 0.46368 0.65523 5 Shade -179.100 1800.83 -0.09945 0.92322 6 Water 1.752 3.53 0.49692 0.63261