[Stata Program]              
 
use http://www.gseis.ucla.edu/courses/data/gpa
 
label variable gpa "graduate grade point average"
label variable greq "GRE exam quantitative score"
label variable grev "GRE exam verbal score"
label variable mat "Miller Analogies Test score"
label variable ar "rating by professors"
 
correlate gpa greq grev mat ar, means
regress gpa greq grev mat ar, beta
vif
sw regress gpa greq grev mat ar, pe(.05)
sw regress gpa greq grev mat ar, pr(.05)
sw regress gpa (greq mat) grev ar, pe(.05) lockterm1
regress gpa greq grev mat ar
test grev ar
test greq mat
regress gpa greq mat grev
test grev
regress gpa greq mat ar
test ar
  
[Stata Output]
 
correlate gpa greq grev mat ar, means
 
(obs=30)
 Variable |         Mean    Std. Dev.          Min          Max
----------+----------------------------------------------------
      gpa |     3.313333     .5998467          2.5          4.3
     greq |     565.3333     48.61767          500          655
     grev |     575.3333     83.03441          480          720
      mat |           67     9.247553           55           85
       ar |     3.566667     .8384441          2.5            5
 
         |      gpa     greq     grev      mat       ar
---------+---------------------------------------------
     gpa |   1.0000
    greq |   0.6111   1.0000
    grev |   0.5815   0.4681   1.0000
     mat |   0.6042   0.2669   0.4257   1.0000
      ar |   0.6207   0.5078   0.4053   0.5248   1.0000
 
regress gpa greq grev mat ar, beta
 
  Source |       SS       df       MS                  Number of obs =      30
---------+------------------------------               F(  4,    25) =   11.13
   Model |  6.68313355     4  1.67078339               Prob > F      =  0.0000
Residual |   3.7515331    25  .150061324               R-squared     =  0.6405
---------+------------------------------               Adj R-squared =  0.5829
   Total |  10.4346666    29  .359816091               Root MSE      =  .38738

------------------------------------------------------------------------------
     gpa |      Coef.   Std. Err.       t     P>|t|                       Beta
---------+--------------------------------------------------------------------
    greq |   .0039983   .0018307      2.184   0.039                   .3240621
    grev |   .0015236   .0010502      1.451   0.159                   .2109123
     mat |   .0208961   .0095488      2.188   0.038                   .3221447
      ar |   .1442335   .1130013      1.276   0.214                   .2016044
   _cons |  -1.738107   .9507399     -1.828   0.079                          .
------------------------------------------------------------------------------
 
vif
 
    Variable |       VIF       1/VIF  
-------------+----------------------
          ar |      1.73    0.576442
        greq |      1.53    0.653236
         mat |      1.51    0.663614
        grev |      1.47    0.680518
-------------+----------------------
    Mean VIF |      1.56
 
sw regress gpa greq grev mat ar, pe(.05)
 
                      begin with empty model
p = 0.0003 <  0.0500  adding   ar
p = 0.0120 <  0.0500  adding   grev

      Source |       SS       df       MS              Number of obs =      30
-------------+------------------------------           F(  2,    27) =   14.36
       Model |   5.3789825     2  2.68949125           Prob > F      =  0.0000
    Residual |  5.05568415    27  .187247561           R-squared     =  0.5155
-------------+------------------------------           Adj R-squared =  0.4796
       Total |  10.4346666    29  .359816091           Root MSE      =  .43272

------------------------------------------------------------------------------
         gpa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
          ar |    .329625    .104835     3.14   0.004     .1145215    .5447286
        grev |   .0028514   .0010586     2.69   0.012     .0006794    .0050234
       _cons |    .497178   .5765156     0.86   0.396    -.6857342     1.68009
------------------------------------------------------------------------------
 
sw regress gpa greq grev mat ar, pr(.05)
 
                      begin with full model
p = 0.2135 >= 0.0500  removing ar
p = 0.1405 >= 0.0500  removing grev
 
      Source |       SS       df       MS              Number of obs =      30
-------------+------------------------------           F(  2,    27) =   18.87
       Model |  6.08344211     2  3.04172105           Prob > F      =  0.0000
    Residual |  4.35122454    27  .161156464           R-squared     =  0.5830
-------------+------------------------------           Adj R-squared =  0.5521
       Total |  10.4346666    29  .359816091           Root MSE      =  .40144

------------------------------------------------------------------------------
         gpa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        greq |   .0059763    .001591     3.76   0.001     .0027118    .0092408
         mat |   .0308074   .0083646     3.68   0.001     .0136446    .0479702
       _cons |  -2.129377   .9270377    -2.30   0.030    -4.031501   -.2272527
------------------------------------------------------------------------------
 
sw regress gpa (greq mat) grev ar, pe(.05) lockterm1
 
                      begin with term 1 model
p >=0.0500            for all terms in model

      Source |       SS       df       MS              Number of obs =      30
-------------+------------------------------           F(  2,    27) =   18.87
       Model |  6.08344211     2  3.04172105           Prob > F      =  0.0000
    Residual |  4.35122454    27  .161156464           R-squared     =  0.5830
-------------+------------------------------           Adj R-squared =  0.5521
       Total |  10.4346666    29  .359816091           Root MSE      =  .40144

------------------------------------------------------------------------------
         gpa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        greq |   .0059763    .001591     3.76   0.001     .0027118    .0092408
         mat |   .0308074   .0083646     3.68   0.001     .0136446    .0479702
       _cons |  -2.129377   .9270377    -2.30   0.030    -4.031501   -.2272527
------------------------------------------------------------------------------
 
regress gpa greq grev mat ar
 
      Source |       SS       df       MS              Number of obs =      30
-------------+------------------------------           F(  4,    25) =   11.13
       Model |  6.68313355     4  1.67078339           Prob > F      =  0.0000
    Residual |   3.7515331    25  .150061324           R-squared     =  0.6405
-------------+------------------------------           Adj R-squared =  0.5829
       Total |  10.4346666    29  .359816091           Root MSE      =  .38738

------------------------------------------------------------------------------
         gpa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        greq |   .0039983   .0018307     2.18   0.039      .000228    .0077686
        grev |   .0015236   .0010502     1.45   0.159    -.0006392    .0036865
         mat |   .0208961   .0095488     2.19   0.038     .0012299    .0405623
          ar |   .1442335   .1130013     1.28   0.214    -.0884969     .376964
       _cons |  -1.738107   .9507399    -1.83   0.079    -3.696192    .2199789
------------------------------------------------------------------------------
 
test grev ar
 
 ( 1)  grev = 0.0
 ( 2)  ar = 0.0

       F(  2,    25) =    2.00
            Prob > F =    0.1567
 
test greq mat
 
 ( 1)  greq = 0.0
 ( 2)  mat = 0.0

       F(  2,    25) =    4.35
            Prob > F =    0.0240
 
regress gpa greq mat grev
 

      Source |       SS       df       MS              Number of obs =      30
-------------+------------------------------           F(  3,    26) =   13.96
       Model |  6.43865846     3  2.14621949           Prob > F      =  0.0000
    Residual |  3.99600819    26  .153692623           R-squared     =  0.6170
-------------+------------------------------           Adj R-squared =  0.5729
       Total |  10.4346666    29  .359816091           Root MSE      =  .39204

------------------------------------------------------------------------------
         gpa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        greq |   .0049255   .0017006     2.90   0.008       .00143    .0084211
         mat |   .0261191   .0087314     2.99   0.006     .0081716    .0440667
        grev |   .0016122   .0010605     1.52   0.141    -.0005676     .003792
       _cons |   -2.14877   .9054056    -2.37   0.025    -4.009858   -.2876821
------------------------------------------------------------------------------
 
test grev
 
 ( 1)  grev = 0.0
 
       F(  1,    26) =    2.31
            Prob > F =    0.1405
 
regress gpa greq mat ar
 
      Source |       SS       df       MS              Number of obs =      30
-------------+------------------------------           F(  3,    26) =   13.57
       Model |  6.36725353     3  2.12241784           Prob > F      =  0.0000
    Residual |  4.06741312    26  .156438966           R-squared     =  0.6102
-------------+------------------------------           Adj R-squared =  0.5652
       Total |  10.4346666    29  .359816091           Root MSE      =  .39552

------------------------------------------------------------------------------
         gpa |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
        greq |   .0049174   .0017537     2.80   0.009     .0013127    .0085221
         mat |   .0249152   .0093304     2.67   0.013     .0057364     .044094
          ar |   .1550651   .1151255     1.35   0.190    -.0815788    .3917089
       _cons |  -1.689019   .9701182    -1.74   0.093    -3.683126    .3050872
------------------------------------------------------------------------------
 
test ar
 
 ( 1)  ar = 0.0

       F(  1,    26) =    1.81
            Prob > F =    0.1896