To expand on Nick's point: matrix regtab = r(table)
gives you an empty matrix, because xthtaylor
doesn't put anything into r(table)
.
To see this run the following example:
clear all // empties r(table) and everything else
webuse psidextract
* the example regression from `help xthtaylor`
xthtaylor lwage wks south smsa ms exp exp2 occ ind union fem blk ed, endog(exp exp2 occ ind union ed) constant(fem blk ed)
return list
doesn't have anything in r(table)
, but ereturn list
will show you that you have access to the coefficients through e(b)
and the variance-covariance matrix through e(V)
.
You can assign these to their own matrices as follows:
matrix betas = e(b)
matrix varcovar = e(V)
Then you can use matrix commands (see help matrix
) to manipulate these matrices.
As you discovered, ereturn display
creates r(table)
which appears quite convenient for your use. It's worth taking a look at help return
for more information about the differences between the contents of return list
and ereturn list
.
xthtaylor
and modifying it, or work with what it does leave behind, as shown byereturn list
. – Nick Coxereturn display
, which showed the results again and thenmatrix tab = r(table)
worked to get the results in a matrix. – 0livier1O1