Dear Statalisters,

I want to export regression results in a neat table. I am using a -matrix- to extract specific scalars post-estimation that I have stored in -local- macros.

However, given I am using Stata version 14 I cannot use -putdocx- which would solve my problem (indeed I have tried this on a friend's Stata and my code works fine which is most frustrating).

Instead, I am hoping to achieve my aim using Attaullah Shah great command -asdoc- which allows for exporting a matrix.

In attempting this I encounter the error: "r(3000): nothing found where subexp expected". I am not sure what to make of this.

Any help would be much appreciated.

Code:
sysuse auto

reg price mpg rep78

local beta1 = _b[mpg]
local se1 = _se[mpg]
local beta2 = _b[rep78]
local se2 = _se[rep78]
local lower1 = `beta1' - invttail(e(df_r), 0.025)*`se1'
local upper1 = `beta1' + invttail(e(df_r), 0.025)*`se1'
local lower2 = `beta2' - invttail(e(df_r), 0.025)*`se2'
local upper2 = `beta2' + invttail(e(df_r), 0.025)*`se2'

matrix stats = (`beta1', `se1', `lower1', `upper1' \ `beta2', `se2', `lower2', `upper2' )

matrix colnames stats = "Beta" "SE" "Lower 95% Confidence interval" "Upper 95% Confidence interval"
matrix rownames stats = "Miles per gallon" "Repair record"

asdoc wmat, mat(stats) replace