This example makes use of the user written command, pathreg. You can obtain pathreg by typing findit pathreg.

use http://www.gseis.ucla.edu/courses/data/terman

summarize
 
    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
         inc |       100          13           4   3.694411   23.08633
         occ |       100           8         1.2   5.310747   11.34572
         edu |       100           9         2.6   3.885739     14.639
         ach |       100          80        15.1   33.31136    120.953
        patt |       100           3          .5   1.780932   4.405661
          iq |       100         130        10.4   100.3054   156.0061
        pedu |       100           7         2.7   .7021856   12.73447
       popoc |       100           6         1.5   1.328781   9.455834
 
corr
(obs=100)

             |      inc      occ      edu      ach     patt       iq     pedu    popoc
-------------+------------------------------------------------------------------------
         inc |   1.0000
         occ |   0.4100   1.0000
         edu |   0.2000   0.3200   1.0000
         ach |  -0.0100   0.0200   0.0600   1.0000
        patt |   0.0800   0.0900   0.1400   0.0030   1.0000
          iq |   0.0900   0.0800   0.1000  -0.1000   0.0800   1.0000
        pedu |   0.0600   0.0800   0.3100   0.0700   0.0300   0.1600   1.0000
       popoc |   0.0600   0.0020   0.1600   0.0400   0.0060   0.1200   0.5000   1.0000
 
pathreg (inc pedu patt occ edu)(occ ach edu)(ach patt popoc)(edu pedu ach popoc)(patt popoc)(iq patt pedu)
 
------------------------------------------------------------------------------
         inc |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
        pedu |   .0095786   .1452895     0.07   0.948                 .0064656
        patt |   .2834574    .754037     0.38   0.708                 .0354322
         occ |   1.279422   .3283948     3.90   0.000                 .3838265
         edu |   .1080164   .1598128     0.68   0.501                 .0702107
       _cons |   .8750569   3.306326     0.26   0.792                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.1746  sqrt(1 - R2) = 0.9085

------------------------------------------------------------------------------
         occ |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         ach |   .0000638   .0076585     0.01   0.993                 .0008029
         edu |   .1476701   .0444781     3.32   0.001                 .3199518
       _cons |   6.665865   .7206794     9.25   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.1024  sqrt(1 - R2) = 0.9474

------------------------------------------------------------------------------
         ach |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
        patt |   .0833558   3.063935     0.03   0.978                 .0027601
       popoc |   .4024998   1.021312     0.39   0.694                 .0399834
       _cons |   77.33493   11.12149     6.95   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.0016  sqrt(1 - R2) = 0.9992

------------------------------------------------------------------------------
         edu |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
        pedu |   .2928398   .1079861     2.71   0.008                 .3041029
         ach |   .0066216   .0167353     0.40   0.693                 .0384564
       popoc |   .0111112   .1940535     0.06   0.954                 .0064103
       _cons |   6.353724   1.664137     3.82   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.0976  sqrt(1 - R2) = 0.9499

------------------------------------------------------------------------------
        patt |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
       popoc |       .002   .0336711     0.06   0.953                     .006
       _cons |      2.988   .2081833    14.35   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.0000  sqrt(1 - R2) = 1.0000

------------------------------------------------------------------------------
          iq |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
        patt |   1.565569   2.079585     0.75   0.453                 .0752678
        pedu |   .6075986   .3851083     1.58   0.118                 .1577419
       _cons |   121.0501   6.800696    17.80   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.0313  sqrt(1 - R2) = 0.9842
 
pathreg (inc occ)(occ ach edu)(ach iq)(edu pedu)(iq patt pedu)
 
------------------------------------------------------------------------------
         inc |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         occ |   1.366667   .3071152     4.45   0.000                      .41
       _cons |   2.066666   2.484135     0.83   0.407                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.1681  sqrt(1 - R2) = 0.9121

------------------------------------------------------------------------------
         occ |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         ach |   .0000638   .0076585     0.01   0.993                 .0008029
         edu |   .1476701   .0444781     3.32   0.001                 .3199518
       _cons |   6.665865   .7206794     9.25   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.1024  sqrt(1 - R2) = 0.9474

------------------------------------------------------------------------------
         ach |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
          iq |  -.1451923   .1459312    -0.99   0.322                      -.1
       _cons |     98.875   19.03106     5.20   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.0100  sqrt(1 - R2) = 0.9950

------------------------------------------------------------------------------
         edu |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
        pedu |   .2985185   .0924819     3.23   0.002                      .31
       _cons |    6.91037   .6934114     9.97   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.0961  sqrt(1 - R2) = 0.9507

------------------------------------------------------------------------------
          iq |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
        patt |   1.565569   2.079585     0.75   0.453                 .0752678
        pedu |   .6075986   .3851083     1.58   0.118                 .1577419
       _cons |   121.0501   6.800696    17.80   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.0313  sqrt(1 - R2) = 0.9842
 
pathreg (inc occ)(occ edu)(edu ped)
 
------------------------------------------------------------------------------
         inc |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         occ |   1.366667   .3071152     4.45   0.000                      .41
       _cons |   2.066666   2.484135     0.83   0.407                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.1681  sqrt(1 - R2) = 0.9121

------------------------------------------------------------------------------
         occ |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
         edu |   .1476923   .0441709     3.34   0.001                      .32
       _cons |   6.670769    .413635    16.13   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.1024  sqrt(1 - R2) = 0.9474

------------------------------------------------------------------------------
         edu |      Coef.   Std. Err.      t    P>|t|                     Beta
-------------+----------------------------------------------------------------
        pedu |   .2985185   .0924819     3.23   0.002                      .31
       _cons |    6.91037   .6934114     9.97   0.000                        .
------------------------------------------------------------------------------
                 n = 100  R2 = 0.0961  sqrt(1 - R2) = 0.9507