REGRESSION with one covariate - YOURNAME 1 A SCATTERPLOT OF Y ON X 01:45 Thursday, September 29, 2005 Plot of yy*xx. Symbol used is '*'. yy | | 400 + | | * | | | * | * 300 + * | | | ** * | | * * | * * * 200 + * * | * | * | * | | * | * 100 + * | ---+-------------+-------------+-------------+-------------+-- 10 12 14 16 18 xx REGRESSION with one covariate - YOURNAME 2 PROC GLM: REGRESSION of yy on xx 01:45 Thursday, September 29, 2005 The GLM Procedure Number of Observations Read 20 Number of Observations Used 20 REGRESSION with one covariate - YOURNAME 3 PROC GLM: REGRESSION of yy on xx 01:45 Thursday, September 29, 2005 The GLM Procedure Dependent Variable: yy Sum of Source DF Squares Mean Square F Value Pr > F Model 1 7872.85802 7872.85802 1.62 0.2189 Error 18 87332.94198 4851.83011 Corrected Total 19 95205.80000 R-Square Coeff Var Root MSE yy Mean 0.082693 31.39030 69.65508 221.9000 Source DF Type I SS Mean Square F Value Pr > F xx 1 7872.858015 7872.858015 1.62 0.2189 Source DF Type III SS Mean Square F Value Pr > F xx 1 7872.858015 7872.858015 1.62 0.2189 Standard Parameter Estimate Error t Value Pr > |t| Intercept 68.45806598 121.4594051 0.56 0.5800 xx 10.25338684 8.0492224 1.27 0.2189 REGRESSION with one covariate - YOURNAME 4 USE PROC PLOT TO DISPLAY CURVE AND PREDICTED VALUES ON THE SAME GRAPH 01:45 Thursday, September 29, 2005 (This may not work in SAS versions earlier than 9.) Plot of yy*xx. Symbol used is '*'. Plot of pred*xx. Symbol used is 'P'. yy | | 400 + | | * | | * | * 300 + * | | * | ** PPP P | * * PP P P PP | * P PPP * * 200 + * P P * | P P * * | | * | | * * 100 + * | ---+-------------+-------------+-------------+-------------+-- 10 12 14 16 18 xx NOTE: 2 obs hidden. REGRESSION with one covariate - YOURNAME 5 PROC GLM RESIDUAL PLOT 01:45 Thursday, September 29, 2005 Plot of resid*xx. Symbol used is '*'. resid | | 200 + | | | 150 + * | | | 100 + * | * | | * 50 + | | * ** * | 0 + * * * | | * * | -50 + * | * * | * * | * * -100 + | ---+------------+------------+------------+------------+-- 10 12 14 16 18 xx REGRESSION with one covariate - YOURNAME 6 PROC UNIVARIATE: Checking the residuals 01:45 Thursday, September 29, 2005 for fit to a normal distribution The UNIVARIATE Procedure Variable: resid Moments N 20 Sum Weights 20 Mean 0 Sum Observations 0 Std Deviation 67.797276 Variance 4596.47063 Skewness 0.59973058 Kurtosis -0.1074824 Uncorrected SS 87332.942 Corrected SS 87332.942 Coeff Variation . Std Error Mean 15.1599318 Basic Statistical Measures Location Variability Mean 0.000000 Std Deviation 67.79728 Median 2.557865 Variance 4596 Mode . Range 248.54390 Interquartile Range 92.20861 Tests for Location: Mu0=0 Test -Statistic- -----p Value------ Student's t t 0 Pr > |t| 1.0000 Sign M 1 Pr >= |M| 0.8238 Signed Rank S -1 Pr >= |S| 0.9854 REGRESSION with one covariate - YOURNAME 7 PROC UNIVARIATE: Checking the residuals 01:45 Thursday, September 29, 2005 for fit to a normal distribution The UNIVARIATE Procedure Variable: resid Tests for Normality Test --Statistic--- -----p Value------ Shapiro-Wilk W 0.949681 Pr < W 0.3623 Kolmogorov-Smirnov D 0.125659 Pr > D >0.1500 Cramer-von Mises W-Sq 0.046044 Pr > W-Sq >0.2500 Anderson-Darling A-Sq 0.330401 Pr > A-Sq >0.2500 Quantiles (Definition 5) Quantile Estimate 100% Max 155.84249 99% 155.84249 95% 130.81715 90% 96.25380 75% Q3 30.07643 50% Median 2.55787 25% Q1 -62.13218 10% -78.81632 5% -88.69552 1% -92.70142 0% Min -92.70142 REGRESSION with one covariate - YOURNAME 8 PROC UNIVARIATE: Checking the residuals 01:45 Thursday, September 29, 2005 for fit to a normal distribution The UNIVARIATE Procedure Variable: resid Extreme Observations ------Lowest----- ------Highest----- Value Obs Value Obs -92.7014 5 30.6398 11 -84.6896 15 61.4371 14 -72.9430 20 86.7158 10 -71.3213 1 105.7918 8 -66.4227 2 155.8425 7 Stem Leaf # Boxplot 1 6 1 | 1 1 1 | 0 69 2 | 0 0013333 7 +--+--+ -0 422 3 | | -0 987776 6 +-----+ ----+----+----+----+ Multiply Stem.Leaf by 10**+2 Normal Probability Plot 175+ * +++ | *++++++++ | +*+*+++ | *+****+** | +++***+ -75+ * *++*+*+** +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 REGRESSION with one covariate - YOURNAME 9 PROC REG: REGRESSION of yy on xx 01:45 Thursday, September 29, 2005 The REG Procedure Model: MODEL1 Dependent Variable: yy Number of Observations Read 20 Number of Observations Used 20 Analysis of Variance Sum of Mean Source DF Squares Square F Value Pr > F Model 1 7872.85802 7872.85802 1.62 0.2189 Error 18 87333 4851.83011 Corrected Total 19 95206 Root MSE 69.65508 R-Square 0.0827 Dependent Mean 221.90000 Adj R-Sq 0.0317 Coeff Var 31.39030 Parameter Estimates Parameter Standard Variable DF Estimate Error t Value Pr > |t| Intercept 1 68.45807 121.45941 0.56 0.5800 xx 1 10.25339 8.04922 1.27 0.2189 REGRESSION with one covariate - YOURNAME 10 PROC REG: REGRESSION of yy on xx 01:45 Thursday, September 29, 2005 The REG Procedure Model: MODEL1 Dependent Variable: yy -------+-------+-------+-------+-------+-------+-------+-------+------- yy | | | | | | | | 400 + + | | | Y | | | | Y | | Y | 300 + Y + | | | Y | | Y Y PPP P | | Y Y P P P P P | | Y PP PP Y Y | 200 + ? P P Y + | P P Y Y | | | | Y | | | | Y Y | 100 + Y + | | | | | | -------+-------+-------+-------+-------+-------+-------+-------+------- 11 12 13 14 15 16 17 18 xx REGRESSION with one covariate - YOURNAME 11 PROC REG: REGRESSION of yy on xx 01:45 Thursday, September 29, 2005 The REG Procedure Model: MODEL1 Dependent Variable: yy -------+------+------+------+------+------+------+------+------- RESIDUAL | | 200 + + | | | | | | 150 + 1 + | | | | | | R 100 + 1 + e | 1 | s | | i | 1 | d 50 + + u | | a | 1 11 1 | l | | 0 + 1 1 1 + | | | 1 1 | | | -50 + 1 + | 1 1 | | 1 1 | | 1 1 | -100 + + -------+------+------+------+------+------+------+------+------- 11 12 13 14 15 16 17 18 xx REGRESSION with one covariate - YOURNAME 12 Y ON X AND X^2: THE DATA AS SAS SEES IT 01:45 Thursday, September 29, 2005 Obs yy xx xx2 1 113 11.3 127.69 2 122 11.7 136.89 3 197 12.5 156.25 4 226 12.5 156.25 5 107 12.8 163.84 6 211 13.3 176.89 7 374 14.6 213.16 8 326 14.8 219.04 9 227 15.0 225.00 10 310 15.1 228.01 11 257 15.4 237.16 12 256 15.6 243.36 13 261 15.9 252.81 14 296 16.2 262.44 15 155 16.7 278.89 16 218 16.8 282.24 17 198 17.0 289.00 18 219 17.1 292.41 19 188 17.3 299.29 20 177 17.7 313.29 REGRESSION with one covariate - YOURNAME 13 PROC GLM: QUADRATIC REGRESSION: yy on xx and xx^2 Include residuals, `Studentized residuals', and `Cook's Residuals' as columns to the dataset 01:45 Thursday, September 29, 2005 The GLM Procedure Number of Observations Read 20 Number of Observations Used 20 REGRESSION with one covariate - YOURNAME 14 PROC GLM: QUADRATIC REGRESSION: yy on xx and xx^2 Include residuals, `Studentized residuals', and `Cook's Residuals' as columns to the dataset 01:45 Thursday, September 29, 2005 The GLM Procedure Dependent Variable: yy Sum of Source DF Squares Mean Square F Value Pr > F Model 2 57267.94844 28633.97422 12.83 0.0004 Error 17 37937.85156 2231.63833 Corrected Total 19 95205.80000 R-Square Coeff Var Root MSE yy Mean 0.601517 21.28897 47.24022 221.9000 Source DF Type I SS Mean Square F Value Pr > F xx 1 7872.85802 7872.85802 3.53 0.0776 xx2 1 49395.09043 49395.09043 22.13 0.0002 Source DF Type III SS Mean Square F Value Pr > F xx 1 51527.80464 51527.80464 23.09 0.0002 xx2 1 49395.09043 49395.09043 22.13 0.0002 REGRESSION with one covariate - YOURNAME 15 PROC GLM: QUADRATIC REGRESSION: yy on xx and xx^2 Include residuals, `Studentized residuals', and `Cook's Residuals' as columns to the dataset 01:45 Thursday, September 29, 2005 The GLM Procedure Dependent Variable: yy Standard Parameter Estimate Error t Value Pr > |t| Intercept -3104.661747 679.4721260 -4.57 0.0003 xx 454.834645 94.6552319 4.81 0.0002 xx2 -15.283740 3.2486254 -4.70 0.0002 REGRESSION with one covariate - YOURNAME 16 Y ON X AND X^2: AFTER THE REGRESSION 01:45 Thursday, September 29, 2005 Obs yy xx xx2 resid rstudent cookd 1 113 11.3 127.69 29.611 0.82655 0.17910 2 122 11.7 136.89 -2.712 -0.06541 0.00057 3 197 12.5 156.25 4.313 0.09507 0.00048 4 226 12.5 156.25 33.313 0.74676 0.02888 5 107 12.8 163.84 -106.134 -2.84524 0.25042 6 211 13.3 176.89 -30.098 -0.66557 0.01958 7 374 14.6 213.16 95.958 2.47704 0.22312 8 326 14.8 219.04 46.859 1.06177 0.05119 9 227 15.0 225.00 -52.017 -1.18441 0.05949 10 310 15.1 228.01 31.504 0.69689 0.02105 11 257 15.4 237.16 -18.100 -0.39385 0.00609 12 256 15.6 243.36 -15.308 -0.33115 0.00394 13 261 15.9 252.81 -2.327 -0.04988 0.00008 14 296 16.2 262.44 43.405 0.95381 0.02542 15 155 16.7 278.89 -73.595 -1.72850 0.09109 16 218 16.8 282.24 -4.878 -0.10571 0.00045 17 198 17.0 289.00 -12.526 -0.27588 0.00388 18 219 17.1 292.41 15.108 0.33634 0.00664 19 188 17.3 299.29 -1.707 -0.03888 0.00012 20 177 17.7 313.29 19.331 0.48577 0.03916 REGRESSION with one covariate - YOURNAME 17 Y ON X AND X^2: AFTER THE REGRESSION 01:45 Thursday, September 29, 2005 PROC GLM QUADRATIC RESIDUAL PLOT Plot of resid*xx. Legend: A = 1 obs, B = 2 obs, etc. resid | 100 + A | | | | 50 + A | A | A A A | A A | 0 + A A A A A | A | AA | A | -50 + A | | A | | -100 + | A | | | -150 + | ---+------------+------------+------------+------------+-- 10 12 14 16 18 xx REGRESSION with one covariate - YOURNAME 18 PROC UNIVARIATE: Checking QUADRATIC residuals 01:45 Thursday, September 29, 2005 The UNIVARIATE Procedure Variable: resid Moments N 20 Sum Weights 20 Mean 0 Sum Observations 0 Std Deviation 44.684774 Variance 1996.72903 Skewness -0.3936416 Kurtosis 1.1877726 Uncorrected SS 37937.8516 Corrected SS 37937.8516 Coeff Variation . Std Error Mean 9.99181923 Basic Statistical Measures Location Variability Mean 0.00000 Std Deviation 44.68477 Median -2.01706 Variance 1997 Mode . Range 202.09167 Interquartile Range 47.26150 Tests for Location: Mu0=0 Test -Statistic- -----p Value------ Student's t t 0 Pr > |t| 1.0000 Sign M -1 Pr >= |M| 0.8238 Signed Rank S 4 Pr >= |S| 0.8983 REGRESSION with one covariate - YOURNAME 19 PROC UNIVARIATE: Checking QUADRATIC residuals 01:45 Thursday, September 29, 2005 The UNIVARIATE Procedure Variable: resid Tests for Normality Test --Statistic--- -----p Value------ Shapiro-Wilk W 0.965153 Pr < W 0.6510 Kolmogorov-Smirnov D 0.142716 Pr > D >0.1500 Cramer-von Mises W-Sq 0.059804 Pr > W-Sq >0.2500 Anderson-Darling A-Sq 0.367097 Pr > A-Sq >0.2500 Quantiles (Definition 5) Quantile Estimate 100% Max 95.95785 99% 95.95785 95% 71.40858 90% 45.13221 75% Q3 30.55751 50% Median -2.01706 25% Q1 -16.70399 10% -62.80562 5% -89.86426 1% -106.13382 0% Min -106.13382 REGRESSION with one covariate - YOURNAME 20 PROC UNIVARIATE: Checking QUADRATIC residuals 01:45 Thursday, September 29, 2005 The UNIVARIATE Procedure Variable: resid Extreme Observations ------Lowest------ -----Highest----- Value Obs Value Obs -106.1338 5 31.5041 10 -73.5947 15 33.3130 4 -52.0165 9 43.4051 14 -30.0983 6 46.8593 8 -18.1001 11 95.9578 7 Stem Leaf # Boxplot 1 0 1 | 0 5 1 | 0 0223334 7 +--+--+ -0 32210000 8 *-----* -0 75 2 | -1 1 1 0 ----+----+----+----+ Multiply Stem.Leaf by 10**+2 Normal Probability Plot 125+ +++ | +++++++*+++ | ++***+**+*+* * | ++*+**+**** * | ++++++++*++* -125++++ * +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2 REGRESSION with one covariate - YOURNAME 21 PROC GLM: QUADRATIC REGRESSION: yy on xx and xx^2 xx^2 listed BEFORE xx in the model statement. 01:45 Thursday, September 29, 2005 The GLM Procedure Number of Observations Read 20 Number of Observations Used 20 REGRESSION with one covariate - YOURNAME 22 PROC GLM: QUADRATIC REGRESSION: yy on xx and xx^2 xx^2 listed BEFORE xx in the model statement. 01:45 Thursday, September 29, 2005 The GLM Procedure Dependent Variable: yy Sum of Source DF Squares Mean Square F Value Pr > F Model 2 57267.94844 28633.97422 12.83 0.0004 Error 17 37937.85156 2231.63833 Corrected Total 19 95205.80000 R-Square Coeff Var Root MSE yy Mean 0.601517 21.28897 47.24022 221.9000 Source DF Type I SS Mean Square F Value Pr > F xx2 1 5740.14381 5740.14381 2.57 0.1272 xx 1 51527.80464 51527.80464 23.09 0.0002 Source DF Type III SS Mean Square F Value Pr > F xx2 1 49395.09043 49395.09043 22.13 0.0002 xx 1 51527.80464 51527.80464 23.09 0.0002 REGRESSION with one covariate - YOURNAME 23 PROC GLM: QUADRATIC REGRESSION: yy on xx and xx^2 xx^2 listed BEFORE xx in the model statement. 01:45 Thursday, September 29, 2005 The GLM Procedure Dependent Variable: yy Standard Parameter Estimate Error t Value Pr > |t| Intercept -3104.661747 679.4721260 -4.57 0.0003 xx2 -15.283740 3.2486254 -4.70 0.0002 xx 454.834645 94.6552319 4.81 0.0002