Actual StataMP numerical output. Log header and machine paths omitted.

. regress logacc trend i.month unem spdlaw beltlaw wkends

      Source |       SS           df       MS      Number of obs   =       108
-------------+----------------------------------   F(16, 91)       =     57.61
       Model |  1.14490873        16  .071556796   Prob > F        =    0.0000
    Residual |  .113028314        91  .001242069   R-squared       =    0.9101
-------------+----------------------------------   Adj R-squared   =    0.8943
       Total |  1.25793704       107  .011756421   Root MSE        =    .03524

------------------------------------------------------------------------------
      logacc | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       trend |   .0011011   .0002579     4.27   0.000     .0005889    .0016133
             |
       month |
          2  |  -.0338346   .0177683    -1.90   0.060    -.0691291    .0014599
          3  |    .076953   .0167941     4.58   0.000     .0435936    .1103123
          4  |   .0104562   .0170469     0.61   0.541    -.0234053    .0443178
          5  |   .0237075   .0169389     1.40   0.165    -.0099395    .0573546
          6  |   .0219334   .0172149     1.27   0.206    -.0122619    .0561288
          7  |   .0499292   .0167036     2.99   0.004     .0167496    .0831088
          8  |   .0559523   .0168173     3.33   0.001     .0225468    .0893578
          9  |   .0420694   .0172819     2.43   0.017     .0077411    .0763977
         10  |    .081717   .0169554     4.82   0.000     .0480372    .1153968
         11  |   .0768721   .0172455     4.46   0.000     .0426161    .1111282
         12  |   .0990862   .0170705     5.80   0.000     .0651778    .1329947
             |
        unem |  -.0212173   .0033974    -6.25   0.000    -.0279659   -.0144688
      spdlaw |  -.0537593   .0126036    -4.27   0.000    -.0787948   -.0287238
     beltlaw |   .0954526    .014235     6.71   0.000     .0671765    .1237288
      wkends |   .0033333   .0037761     0.88   0.380    -.0041675    .0108342
       _cons |   10.63986   .0630859   168.66   0.000     10.51455    10.76518
------------------------------------------------------------------------------

. * END conventional
. estimates store conventional

. scalar b_ols=_b[beltlaw]

. scalar se_ols=_se[beltlaw]

. predict double residual, residuals

. * BEGIN robust
. regress logacc trend i.month unem spdlaw beltlaw wkends, vce(robust)

Linear regression                               Number of obs     =        108
                                                F(16, 91)         =      51.37
                                                Prob > F          =     0.0000
                                                R-squared         =     0.9101
                                                Root MSE          =     .03524

------------------------------------------------------------------------------
             |               Robust
      logacc | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       trend |   .0011011   .0002676     4.12   0.000     .0005696    .0016326
             |
       month |
          2  |  -.0338346    .021402    -1.58   0.117    -.0763471    .0086779
          3  |    .076953   .0215727     3.57   0.001     .0341013    .1198046
          4  |   .0104562   .0189763     0.55   0.583    -.0272378    .0481503
          5  |   .0237075    .018758     1.26   0.210    -.0135529    .0609679
          6  |   .0219334   .0200891     1.09   0.278    -.0179711    .0618379
          7  |   .0499292   .0198585     2.51   0.014     .0104827    .0893756
          8  |   .0559523   .0193811     2.89   0.005     .0174541    .0944505
          9  |   .0420694   .0186208     2.26   0.026     .0050814    .0790574
         10  |    .081717   .0211651     3.86   0.000     .0396752    .1237588
         11  |   .0768721   .0199737     3.85   0.000     .0371969    .1165474
         12  |   .0990862    .021658     4.58   0.000     .0560653    .1421072
             |
        unem |  -.0212173   .0038238    -5.55   0.000    -.0288128   -.0136218
      spdlaw |  -.0537593   .0120059    -4.48   0.000    -.0776076    -.029911
     beltlaw |   .0954526   .0123682     7.72   0.000     .0708847    .1200206
      wkends |   .0033333   .0039443     0.85   0.400    -.0045016    .0111682
       _cons |   10.63986   .0681238   156.18   0.000     10.50454    10.77518
------------------------------------------------------------------------------

. * END robust
. scalar se_robust=_se[beltlaw]

. assert abs(_b[beltlaw]-b_ols)<1e-10

. * BEGIN hac
. newey logacc trend i.month unem spdlaw beltlaw wkends, lag(4)

Regression with Newey–West standard errors      Number of obs     =        108
Maximum lag = 4                                 F( 16,        91) =      37.42
                                                Prob > F          =     0.0000

------------------------------------------------------------------------------
             |             Newey–West
      logacc | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
       trend |   .0011011   .0003897     2.83   0.006      .000327    .0018752
             |
       month |
          2  |  -.0338346   .0168283    -2.01   0.047    -.0672619   -.0004073
          3  |    .076953   .0183367     4.20   0.000     .0405293    .1133766
          4  |   .0104562   .0176927     0.59   0.556    -.0246882    .0456006
          5  |   .0237075    .018769     1.26   0.210    -.0135748    .0609899
          6  |   .0219334   .0200354     1.09   0.277    -.0178644    .0617313
          7  |   .0499292   .0200711     2.49   0.015     .0100605    .0897979
          8  |   .0559523   .0194475     2.88   0.005     .0173223    .0945823
          9  |   .0420694   .0187812     2.24   0.028     .0047629    .0793759
         10  |    .081717    .021099     3.87   0.000     .0398064    .1236276
         11  |   .0768721   .0210425     3.65   0.000     .0350737    .1186705
         12  |   .0990862   .0241168     4.11   0.000     .0511812    .1469913
             |
        unem |  -.0212173   .0051302    -4.14   0.000    -.0314079   -.0110268
      spdlaw |  -.0537593   .0170449    -3.15   0.002    -.0876169   -.0199018
     beltlaw |   .0954526   .0188985     5.05   0.000     .0579131    .1329922
      wkends |   .0033333   .0028746     1.16   0.249    -.0023768    .0090434
       _cons |   10.63986   .0635823   167.34   0.000     10.51356    10.76616
------------------------------------------------------------------------------

. * END hac
. scalar se_hac=_se[beltlaw]

. assert abs(_b[beltlaw]-b_ols)<1e-10

. * BEGIN exact_change
. nlcom 100*(exp(_b[beltlaw])-1)

       _nl_1: 100*(exp(_b[beltlaw])-1)

------------------------------------------------------------------------------
      logacc | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
-------------+----------------------------------------------------------------
       _nl_1 |   10.01567    2.07913     4.82   0.000     5.940653    14.09069
------------------------------------------------------------------------------

. * END exact_change
. * BEGIN bg
. estimates restore conventional
(results conventional are active now)

. estat bgodfrey, lags(1 4)

Breusch–Godfrey LM test for autocorrelation
---------------------------------------------------------------------------
    lags(p)  |          chi2               df                 Prob > chi2
-------------+-------------------------------------------------------------
       1     |         13.010               1                   0.0003
       4     |         16.907               4                   0.0020
---------------------------------------------------------------------------
                        H0: no serial correlation

. * END bg
. generate lag_residual=L.residual
(1 missing value generated)

. * Export the numeric Stata date; the downloadable do-file reapplies %tm.
. format month_id %9.0g

. export delimited month_id month year totacc logacc residual lag_residual trend unem spdlaw beltlaw
>  wkends using "output/traffic.csv", replace
file output/traffic.csv saved

. file open stats using "output/traffic_stats.csv", write replace

. file write stats "method,coefficient,se" _n

. file write stats "Conventional," (b_ols) "," (se_ols) _n

. file write stats "Robust," (b_ols) "," (se_robust) _n

. file write stats "HAC_4," (b_ols) "," (se_hac) _n

. file close stats

. display "ECO603_MEETING_11_COMPLETE"
ECO603_MEETING_11_COMPLETE

