[SAS Program] data agresti; input p s be ba new; cards; 48.5 1.10 3 1 0 55.0 1.01 3 2 0 68.0 1.45 3 2 0 137.0 2.40 3 3 0 309.4 3.30 4 3 1 17.5 .40 1 1 0 19.6 1.28 3 1 0 24.5 .74 3 1 0 34.8 .78 2 1 0 32.0 .97 3 1 0 28.0 .84 3 1 0 49.9 1.08 2 2 0 59.9 .99 2 1 0 61.5 1.01 3 2 0 60.0 1.34 3 2 0 65.9 1.22 3 1 0 67.9 1.28 3 2 0 68.9 1.29 3 2 0 69.9 1.52 3 2 0 70.5 1.25 3 2 0 72.9 1.28 3 2 0 72.5 1.28 3 1 0 72.0 1.36 3 2 0 71.0 1.20 3 2 0 76.0 1.46 3 2 0 72.9 1.56 4 2 0 73.0 1.22 3 2 0 70.0 1.40 2 2 0 76.0 1.15 2 2 0 69.0 1.74 3 2 0 75.5 1.62 3 2 0 76.0 1.66 3 2 0 81.8 1.33 3 2 0 84.5 1.34 3 2 0 83.5 1.40 3 2 0 86.0 1.15 2 2 1 86.9 1.58 3 2 1 86.9 1.58 3 2 1 86.9 1.58 3 2 1 87.9 1.71 3 2 0 88.1 2.10 3 2 0 85.9 1.27 3 2 0 89.5 1.34 3 2 0 87.4 1.25 3 2 0 87.9 1.68 3 2 0 88.0 1.55 3 2 0 90.0 1.55 3 2 0 96.0 1.36 3 2 1 99.9 1.51 3 2 1 95.5 1.54 3 2 1 98.5 1.51 3 2 0 100.1 1.85 3 2 0 99.9 1.62 4 2 1 101.9 1.40 3 2 1 101.9 1.92 4 2 0 102.3 1.42 3 2 1 110.8 1.56 3 2 1 105.0 1.43 3 2 1 97.9 2.00 3 2 0 106.3 1.45 3 2 1 106.5 1.65 3 2 0 116.0 1.72 4 2 1 108.0 1.79 4 2 1 107.5 1.85 3 2 0 109.9 2.06 4 2 1 110.0 1.76 4 2 0 120.0 1.62 3 2 1 115.0 1.80 4 2 1 113.4 1.98 3 2 0 114.9 1.57 3 2 0 115.0 2.19 3 2 0 115.0 2.07 4 2 0 117.9 1.99 4 2 0 110.0 1.55 3 2 0 115.0 1.67 3 2 0 124.0 2.40 4 2 0 129.9 1.79 4 2 1 124.0 1.89 3 2 0 128.0 1.88 3 2 1 132.4 2.00 4 2 1 139.3 2.05 4 2 1 139.3 2.00 4 2 1 139.7 2.03 3 2 1 142.0 2.12 3 3 0 141.3 2.08 4 2 1 147.5 2.19 4 2 0 142.5 2.40 4 2 0 148.0 2.40 5 2 0 149.0 3.05 4 2 0 150.0 2.04 3 3 0 172.9 2.25 4 2 1 190.0 2.57 4 3 1 280.0 3.85 4 3 0 ; run; proc means data=agresti; var p s; run; proc corr data=agresti; var p s; run; proc plot data=agresti; plot p * s; run; proc reg data=agresti; model p = s / adjrsq stb; output out=resid student=sresid; plot (p)*(s) (residual.)*(s predicted.)/hplots=2 vplots=2; run; proc chart data=resid; vbar sresid; run; proc univariate plot data=resid; var sresid; run; [Stata Output] The SAS System Variable N Mean Std Dev Minimum Maximum -------------------------------------------------------------------- P 93 99.5333333 44.1841338 17.5000000 309.4000000 S 93 1.6496774 0.5252607 0.4000000 3.8500000 -------------------------------------------------------------------- Correlation Analysis 2 'VAR' Variables: P S Simple Statistics Variable N Mean Std Dev Sum Minimum Maximum P 93 99.533333 44.184134 9256.600000 17.500000 309.400000 S 93 1.649677 0.525261 153.420000 0.400000 3.850000 Pearson Correlation Coefficients / Prob > |R| under Ho: Rho=0 / N = 93 P S P 1.00000 0.89881 0.0 0.0001 S 0.89881 1.00000 0.0001 0.0 Plot of P*S. Legend: A = 1 obs, B = 2 obs, etc. P | 350 + | | | | | A 300 + | | A | | | 250 + | | | | | 200 + | A | | A | | 150 + A A A A | ABAA A | A A A | AA A | AAAA A B A A | AA B A B A A 100 + AB B A AA A | A C AA A | A BB A C | AAAB A A A AA | AC AAA A | C A 50 + B | | A A | A A | A A | 0 + --+----------+----------+----------+----------+----------+----------+----------+----------+- 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 S Model: MODEL1 Dependent Variable: P Analysis of Variance Sum of Mean Source DF Squares Square F Value Prob>F Model 1 145097.46423 145097.46423 382.628 0.0001 Error 91 34508.40244 379.21321 C Total 92 179605.86667 Root MSE 19.47340 R-square 0.8079 Dep Mean 99.53333 Adj R-sq 0.8058 C.V. 19.56470 Parameter Estimates Parameter Standard T for H0: Standardized Variable DF Estimate Error Parameter=0 Prob > |T| Estimate INTERCEP 1 -25.193563 6.68844982 -3.767 0.0003 0.00000000 S 1 75.606840 3.86520832 19.561 0.0001 0.89881364 ----+---+---+---+---+---+---+---+---+---- ---+---+---+---+---+---+---+---+---+---- | | | | | | | | 400 + + 100 + + | | | 1 | | | | | | | | | P 300 + 1 + R 50 + + | 1 | E | | | | S | 1 3121 1 1 1 | | | I | 1 21244212421 1 | 200 + 1 + D 0 + 1 1 82313 + | 1 | U | 1112 2241321 2 | | 4212 1 | A | 22 2 11 | | 3323112 | L | 1 1 | 100 + 5833321 + -50 + 1 1 + | 2*5451 | | 1 | | 32 1 | | | | 1 211 1 | | | 0 + + -100 + + | | | | ----+---+---+---+---+---+---+---+---+---- ---+---+---+---+---+---+---+---+---+---- 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 S S -+-----+-----+-----+-----+-----+-----+-- | | | | 100 + + | 1 | | | | | R 50 + + E | | S | 1 4111 1 1 1 | I | 1 2124 4212331 1 | D 0 + 1 1 451313 + U | 1112 1332 321 2 | A | 22 111 1 | L | 1 1 | -50 + 1 1 + | 1 | | | | | -100 + + | | -+-----+-----+-----+-----+-----+-----+-- 0 50 100 150 200 250 300 PRED Frequency | ***** | ***** | ***** | ***** 40 + ***** | ***** | ***** | ***** ***** | ***** ***** 30 + ***** ***** | ***** ***** | ***** ***** | ***** ***** | ***** ***** 20 + ***** ***** | ***** ***** | ***** ***** | ***** ***** | ***** ***** 10 + ***** ***** | ***** ***** | ***** ***** ***** | ***** ***** ***** | ***** ***** ***** ***** ***** ***** ------------------------------------------------------------------------------ -3.0 -1.8 -0.6 0.6 1.8 3.0 4.2 Studentized Residual Univariate Procedure Variable=SRESID Studentized Residual Moments Quantiles(Def=5) N 93 Sum Wgts 93 100% Max 4.652866 99% 4.652866 Mean 0.002288 Sum 0.212789 75% Q3 0.590894 95% 1.140879 Std Dev 1.019546 Variance 1.039475 50% Med 0.109768 90% 1.085245 Skewness 0.347878 Kurtosis 4.473734 25% Q1 -0.55086 10% -1.0701 USS 95.63218 CSS 95.63169 0% Min -3.03318 5% -1.68474 CV 44559.61 Std Mean 0.105722 1% -3.03318 T:Mean=0 0.021642 Pr>|T| 0.9828 Range 7.686042 Num ^= 0 93 Num > 0 51 Q3-Q1 1.141753 M(Sign) 4.5 Pr>=|M| 0.4069 Mode -0.38031 Sgn Rank 78.5 Pr>=|S| 0.7654 Extremes Lowest Obs Highest Obs -3.03318( 89) 1.140879( 58) -2.69125( 7) 1.172573( 67) -2.35773( 41) 1.258087( 36) -1.92935( 30) 1.455005( 91) -1.68474( 76) 4.652866( 5) Stem Leaf # Boxplot 4 7 1 * 4 3 3 2 2 1 5 1 | 1 0011111123 10 | 0 55555666677777889999 20 +-----+ 0 0111111222333334444 19 *--+--* -0 444444333222111 15 | | -0 98888887766555 14 +-----+ -1 3311000 7 | -1 975 3 | -2 4 1 0 -2 7 1 0 -3 0 1 0 ----+----+----+----+ Univariate Procedure Variable=SRESID Studentized Residual Normal Probability Plot 4.75+ * | | | | + | +++++ | +++++ | ++***** ** * 0.75+ ******* | ******* | ****** | ******+ | ******+ | +*+*+ | +++++* |+ * -3.25+* +----+----+----+----+----+----+----+----+----+----+ -2 -1 0 +1 +2