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

. regress score str, vce(robust)

Linear regression                               Number of obs     =        420
                                                F(1, 418)         =      19.26
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0512
                                                Root MSE          =     18.581

------------------------------------------------------------------------------
             |               Robust
       score | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         str |  -2.279808   .5194892    -4.39   0.000    -3.300945   -1.258671
       _cons |    698.933   10.36436    67.44   0.000     678.5602    719.3057
------------------------------------------------------------------------------

. * END simple
. scalar simple_b = _b[str]

. scalar simple_se = _se[str]

. scalar simple_a = _b[_cons]

. * BEGIN contrast
. lincom -2*str

 ( 1)  - 2*str = 0

------------------------------------------------------------------------------
       score | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   4.559617   1.038978     4.39   0.000     2.517343     6.60189
------------------------------------------------------------------------------

. * END contrast
. * BEGIN adjusted
. regress score str el, vce(robust)

Linear regression                               Number of obs     =        420
                                                F(2, 417)         =     223.82
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4264
                                                Root MSE          =     14.464

------------------------------------------------------------------------------
             |               Robust
       score | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         str |  -1.101296   .4328472    -2.54   0.011     -1.95213   -.2504616
          el |  -.6497768   .0310318   -20.94   0.000     -.710775   -.5887786
       _cons |   686.0322   8.728224    78.60   0.000     668.8754     703.189
------------------------------------------------------------------------------

. * END adjusted
. scalar adjusted_b = _b[str]

. scalar adjusted_se = _se[str]

. scalar adjusted_a = _b[_cons]

. scalar el_b = _b[el]

. * Same observations: the coefficient change is not a sample change.
. assert e(N)==420

. * BEGIN adjusted_contrast
. lincom -2*str

 ( 1)  - 2*str = 0

------------------------------------------------------------------------------
       score | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         (1) |   2.202592   .8656943     2.54   0.011     .5009232     3.90426
------------------------------------------------------------------------------

. * END adjusted_contrast
. * Independent numerical checks of the OLS normal equations.
. predict double residual, residuals

. quietly summarize residual

. assert abs(r(mean)) < 1e-8

. generate double orth = residual*str

. quietly summarize orth

. assert abs(r(mean)) < 1e-6

. export delimited score str el using "output/schools.csv", replace
file output/schools.csv saved

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

. file write stats "model,intercept,slope,se,el_slope,n" _n

. file write stats "simple," (simple_a) "," (simple_b) "," (simple_se) ",0,420" _n

. file write stats "adjusted," (adjusted_a) "," (adjusted_b) "," (adjusted_se) "," (el_b) ",420" _n

. file close stats

. display "ECO603_MEETING_01_COMPLETE"
ECO603_MEETING_01_COMPLETE



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

. * BEGIN short
. regress score str, vce(robust)

Linear regression                               Number of obs     =        420
                                                F(1, 418)         =      19.26
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0512
                                                Root MSE          =     18.581

------------------------------------------------------------------------------
             |               Robust
       score | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         str |  -2.279808   .5194892    -4.39   0.000    -3.300945   -1.258671
       _cons |    698.933   10.36436    67.44   0.000     678.5602    719.3057
------------------------------------------------------------------------------

. * END short
. record short str

. * BEGIN long
. regress score str el, vce(robust)

Linear regression                               Number of obs     =        420
                                                F(2, 417)         =     223.82
                                                Prob > F          =     0.0000
                                                R-squared         =     0.4264
                                                Root MSE          =     14.464

------------------------------------------------------------------------------
             |               Robust
       score | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         str |  -1.101296   .4328472    -2.54   0.011     -1.95213   -.2504616
          el |  -.6497768   .0310318   -20.94   0.000     -.710775   -.5887786
       _cons |   686.0322   8.728224    78.60   0.000     668.8754     703.189
------------------------------------------------------------------------------

. * END long
. record long str

. record language el

. * BEGIN auxiliary
. regress el str

      Source |       SS           df       MS      Number of obs   =       420
-------------+----------------------------------   F(1, 418)       =     15.25
       Model |  4932.98526         1  4932.98526   Prob > F        =    0.0001
    Residual |    135170.2       418  323.373684   R-squared       =    0.0352
-------------+----------------------------------   Adj R-squared   =    0.0329
       Total |  140103.185       419  334.375143   Root MSE        =    17.983

------------------------------------------------------------------------------
          el | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         str |   1.813719   .4643735     3.91   0.000     .9009206    2.726517
       _cons |  -19.85405   9.162604    -2.17   0.031    -37.86458   -1.843531
------------------------------------------------------------------------------

. * END auxiliary
. record auxiliary str

. * BEGIN income
. regress score str el income, vce(robust)

Linear regression                               Number of obs     =        420
                                                F(3, 416)         =     299.03
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7072
                                                Root MSE          =     10.347

------------------------------------------------------------------------------
             |               Robust
       score | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         str |  -.0687755   .2901597    -0.24   0.813    -.6391376    .5015865
          el |  -.4882667   .0281161   -17.37   0.000     -.543534   -.4329995
      income |   1.494517     .09156    16.32   0.000     1.314539    1.674495
       _cons |   640.3155   5.991918   106.86   0.000     628.5373    652.0937
------------------------------------------------------------------------------

. * END income
. record income str

. export delimited score str el income using "output/meeting_02_data.csv", replace
(file output/meeting_02_data.csv not found)
file output/meeting_02_data.csv saved

. 
. postclose results

. use "output/meeting_02_estimates.dta", clear

. export delimited using "output/meeting_02_estimates.csv", replace
(file output/meeting_02_estimates.csv not found)
file output/meeting_02_estimates.csv saved

. display "ECO603_MEETING_02_COMPLETE"
ECO603_MEETING_02_COMPLETE



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

. * BEGIN full
. regress score str el income, vce(robust)

Linear regression                               Number of obs     =        420
                                                F(3, 416)         =     299.03
                                                Prob > F          =     0.0000
                                                R-squared         =     0.7072
                                                Root MSE          =     10.347

------------------------------------------------------------------------------
             |               Robust
       score | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         str |  -.0687755   .2901597    -0.24   0.813    -.6391376    .5015865
          el |  -.4882667   .0281161   -17.37   0.000     -.543534   -.4329995
      income |   1.494517     .09156    16.32   0.000     1.314539    1.674495
       _cons |   640.3155   5.991918   106.86   0.000     628.5373    652.0937
------------------------------------------------------------------------------

. * END full
. record full str

. scalar full_b=_b[str]

. quietly regress score el income

. predict double ry, residuals

. quietly regress str el income

. predict double rx, residuals

. * BEGIN fwl
. regress ry rx, noconstant

      Source |       SS           df       MS      Number of obs   =       420
-------------+----------------------------------   F(1, 419)       =      0.06
       Model |  6.60482474         1  6.60482474   Prob > F        =    0.8033
    Residual |  44540.7318       419  106.302463   R-squared       =    0.0001
-------------+----------------------------------   Adj R-squared   =   -0.0022
       Total |  44547.3367       420  106.065087   Root MSE        =     10.31

------------------------------------------------------------------------------
          ry | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
          rx |  -.0687755   .2759147    -0.25   0.803    -.6111251     .473574
------------------------------------------------------------------------------

. * END fwl
. record partial rx

. assert abs(_b[rx]-full_b)<1e-8

. * BEGIN vif
. quietly regress score str el income

. estat vif

    Variable |       VIF       1/VIF  
-------------+----------------------
      income |      1.14    0.873929
          el |      1.12    0.891206
         str |      1.07    0.931159
-------------+----------------------
    Mean VIF |      1.11

. * END vif
. export delimited score str el income rx ry using "output/meeting_03_data.csv", replace
(file output/meeting_03_data.csv not found)
file output/meeting_03_data.csv saved

. 
. postclose results

. use "output/meeting_03_estimates.dta", clear

. export delimited using "output/meeting_03_estimates.csv", replace
(file output/meeting_03_estimates.csv not found)
file output/meeting_03_estimates.csv saved

. display "ECO603_MEETING_03_COMPLETE"
ECO603_MEETING_03_COMPLETE



Actual StataMP coefficient-only results. Log header omitted.

. import delimited "output/meeting_02_data.csv", clear varnames(1) asdouble
(encoding automatically selected: ISO-8859-1)
(4 vars, 420 obs)

. * BEGIN simple
. quietly regress score str

. matrix list e(b), format(%10.6f)

e(b)[1,2]
           str       _cons
y1   -2.279808  698.932953

. * END simple
. * BEGIN contrast
. display %10.6f -2*_b[str]
  4.559617

. * END contrast
. * BEGIN adjusted
. quietly regress score str el

. matrix list e(b), format(%10.6f)

e(b)[1,3]
           str          el       _cons
y1   -1.101296   -0.649777  686.032250

. * END adjusted
. * BEGIN adjusted_contrast
. display %10.6f -2*_b[str]
  2.202592

. * END adjusted_contrast
. * BEGIN auxiliary
. quietly regress el str

. matrix list e(b), format(%10.6f)

e(b)[1,2]
           str       _cons
y1    1.813719  -19.854055

. * END auxiliary
. * BEGIN income
. quietly regress score str el income

. matrix list e(b), format(%10.6f)

e(b)[1,4]
           str          el      income       _cons
y1   -0.068776   -0.488267    1.494517  640.315497

. * END income
. quietly regress score el income

. predict double ry, residuals

. quietly regress str el income

. predict double rx, residuals

. * BEGIN partial
. quietly regress ry rx, noconstant

. matrix list e(b), format(%10.6f)

symmetric e(b)[1,1]
           rx
y1  -0.068776

. * END partial
. display "ECO603_COEFFICIENT_WORKSHOP_COMPLETE"
ECO603_COEFFICIENT_WORKSHOP_COMPLETE

