[Stata Program]              
               
use http://www.gseis.ucla.edu/courses/data/gpa

regress greq grev, beta
predict rgreq, residual
regress gpa grev, beta
predict resgpa, residual
correlate gpa grev greq rgreq resgpa, means
regress gpa rgreq, beta
regress resgpa rgreq, beta
regress gpa grev greq, beta


[Stata Output]

regress greq grev, beta

  Source |       SS       df       MS                  Number of obs =      30
---------+------------------------------               F(  1,    28) =    7.86
   Model |   15017.378     1   15017.378               Prob > F      =  0.0091
Residual |  53529.2886    28  1911.76031               R-squared     =  0.2191
---------+------------------------------               Adj R-squared =  0.1912
   Total |  68546.6667    29  2363.67816               Root MSE      =  43.724

------------------------------------------------------------------------------
    greq |      Coef.   Std. Err.       t     P>|t|                       Beta
---------+--------------------------------------------------------------------
    grev |   .2740564   .0977822      2.803   0.009                   .4680625
   _cons |   407.6595   56.82089      7.174   0.000                          .
------------------------------------------------------------------------------

predict rgreq, residual

regress gpa grev, beta

  Source |       SS       df       MS                  Number of obs =      30
---------+------------------------------               F(  1,    28) =   14.30
   Model |  3.52782074     1  3.52782074               Prob > F      =  0.0008
Residual |  6.90684591    28  .246673068               R-squared     =  0.3381
---------+------------------------------               Adj R-squared =  0.3144
   Total |  10.4346666    29  .359816091               Root MSE      =  .49666

------------------------------------------------------------------------------
     gpa |      Coef.   Std. Err.       t     P>|t|                       Beta
---------+--------------------------------------------------------------------
    grev |   .0042005   .0011107      3.782   0.001                   .5814521
   _cons |   .8966725   .6454345      1.389   0.176                          .
------------------------------------------------------------------------------

predict resgpa, residual

correlate gpa grev greq rgreq resgpa, means

(obs=30)
 Variable |         Mean    Std. Dev.          Min          Max
----------+----------------------------------------------------
      gpa |     3.313333     .5998467          2.5          4.3
     grev |     575.3333     83.03441          480          720
     greq |     565.3333     48.61767          500          655
    rgreq |    -3.18e-07     42.96321    -52.02029     100.7203
   resgpa |    -2.24e-09     .4880237    -.8789944     .8560849


         |      gpa     grev     greq    rgreq   resgpa
---------+---------------------------------------------
     gpa |   1.0000
    grev |   0.5815   1.0000
    greq |   0.6111   0.4681   1.0000
   rgreq |   0.3836   0.0000   0.8837   1.0000
  resgpa |   0.8136   0.0000   0.4167   0.4715   1.0000


regress gpa rgreq, beta

  Source |       SS       df       MS                  Number of obs =      30
---------+------------------------------               F(  1,    28) =    4.83
   Model |  1.53550517     1  1.53550517               Prob > F      =  0.0364
Residual |  8.89916147    28  .317827195               R-squared     =  0.1472
---------+------------------------------               Adj R-squared =  0.1167
   Total |  10.4346666    29  .359816091               Root MSE      =  .56376

------------------------------------------------------------------------------
     gpa |      Coef.   Std. Err.       t     P>|t|                       Beta
---------+--------------------------------------------------------------------
   rgreq |   .0053559   .0024367      2.198   0.036                   .3836068
   _cons |   3.313333   .1029283     32.191   0.000                          .
------------------------------------------------------------------------------

regress resgpa rgreq, beta

  Source |       SS       df       MS                  Number of obs =      30
---------+------------------------------               F(  1,    28) =    8.00
   Model |  1.53550514     1  1.53550514               Prob > F      =  0.0085
Residual |  5.37134068    28  .191833596               R-squared     =  0.2223
---------+------------------------------               Adj R-squared =  0.1945
   Total |  6.90684583    29  .238167097               Root MSE      =  .43799

------------------------------------------------------------------------------
  resgpa |      Coef.   Std. Err.       t     P>|t|                       Beta
---------+--------------------------------------------------------------------
   rgreq |   .0053559   .0018931      2.829   0.009                   .4715044
   _cons |  -5.33e-10   .0799653      0.000   1.000                          .
------------------------------------------------------------------------------

regress gpa grev greq, beta

  Source |       SS       df       MS                  Number of obs =      30
---------+------------------------------               F(  2,    27) =   12.73
   Model |  5.06332584     2  2.53166292               Prob > F      =  0.0001
Residual |  5.37134081    27  .198938548               R-squared     =  0.4852
---------+------------------------------               Adj R-squared =  0.4471
   Total |  10.4346666    29  .359816091               Root MSE      =  .44603

------------------------------------------------------------------------------
     gpa |      Coef.   Std. Err.       t     P>|t|                       Beta
---------+--------------------------------------------------------------------
    grev |   .0027326   .0011288      2.421   0.022                    .378269
    greq |   .0053559   .0019278      2.778   0.010                    .434094
   _cons |  -1.286698   .9765207     -1.318   0.199                          .
------------------------------------------------------------------------------