[Stata Program] input id x y 1 1 3 2 1 5 3 1 6 4 1 9 5 2 4 6 2 6 7 2 7 8 2 10 9 3 4 10 3 6 11 3 8 12 3 10 13 4 5 14 4 7 15 4 9 16 4 12 17 5 7 18 5 10 19 5 12 20 5 6 end summarize y x correlate y x regress y x regress, beta predict p predict r, rstu list y p r plot y x plot r id plot r p plot r x graph r, bin(7) normal stem r pnorm r [Stata Output] summarize y x Variable | Obs Mean Std. Dev. Min Max ---------+----------------------------------------------------- y | 20 7.3 2.617753 3 12 x | 20 3 1.450953 1 5 correlate y x (obs=20) | y x ---------+------------------ y | 1.0000 x | 0.4157 1.0000 regress y x Source | SS df MS Number of obs = 20 ---------+------------------------------ F( 1, 18) = 3.76 Model | 22.50 1 22.50 Prob > F = 0.0683 Residual | 107.70 18 5.98333333 R-squared = 0.1728 ---------+------------------------------ Adj R-squared = 0.1269 Total | 130.20 19 6.85263158 Root MSE = 2.4461 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| [95% Conf. Interval] ---------+-------------------------------------------------------------------- x | .75 .38676 1.939 0.068 -.0625527 1.562553 _cons | 5.05 1.282738 3.937 0.001 2.355068 7.744932 ------------------------------------------------------------------------------ regress, beta Source | SS df MS Number of obs = 20 ---------+------------------------------ F( 1, 18) = 3.76 Model | 22.50 1 22.50 Prob > F = 0.0683 Residual | 107.70 18 5.98333333 R-squared = 0.1728 ---------+------------------------------ Adj R-squared = 0.1269 Total | 130.20 19 6.85263158 Root MSE = 2.4461 ------------------------------------------------------------------------------ y | Coef. Std. Err. t P>|t| Beta ---------+-------------------------------------------------------------------- x | .75 .38676 1.939 0.068 .4157055 _cons | 5.05 1.282738 3.937 0.001 . ------------------------------------------------------------------------------ predict p (option xb assumed; fitted values) predict r, rstu list y p r y p r 1. 4 7.3 -1.423003 2. 5 8.05 -1.323221 3. 6 8.8 -1.261847 4. 3 5.8 -1.261847 5. 4 6.55 -1.08954 6. 7 8.8 -.7897767 7. 6 7.3 -.5343365 8. 7 8.05 -.4361658 9. 5 5.8 -.3459558 10. 6 6.55 -.2275458 11. 6 5.8 .0862049 12. 7 6.55 .1860802 13. 8 7.3 .2860193 14. 9 8.05 .3942262 15. 10 8.8 .5212322 16. 10 7.3 1.142008 17. 9 5.8 1.463241 18. 12 8.8 1.463241 19. 10 6.55 1.518778 20. 12 8.05 1.776766 plot y x 12 + | * * | | | | | * * * | | * * | y | * | | * * * | | * * * * | | * * | | * * | 3 + * +----------------------------------------------------------------+ 1 x 5 plot r id 1.77677 + S | * t | u | * * * d | e | * n | t | i | z | * e | * * d | * | * r | * e | * s | * * i | d | * u | a | * -1.423 + * * * * +----------------------------------------------------------------+ 1 id 20 plot r p 1.77677 + S | * t | u | * * * d | e | * n | t | i | z | * e | * * d | * | * r | * e | * s | * * i | d | * u | a | * -1.423 + * * * * +----------------------------------------------------------------+ 5.8 Fitted values 8.8 plot r x 1.77677 + S | * t | u | * * * d | e | * n | t | i | z | * e | * * d | * | * r | * e | * s | * * i | d | * u | a | * -1.423 + * * * * +----------------------------------------------------------------+ 1 x 5 graph r, bin(7) normal stem r Stem-and-leaf plot for r (Studentized residuals) r rounded to nearest multiple of .01 plot in units of .01 -1** | 42,32,26,26,09 -0** | 79,53 -0** | 44,35,23 0** | 09,19,29,39 0** | 52 1** | 14,46,46 1** | 52,78 pnorm r