Attaullah Shah
Keymaster
Post count: 69

This is not possible using the wide and nest options together. However, such customized tables can be easily made with the new asdocx. Here is the code to be used with asdocx


*Add the first header row
asdocx addrow, data(Effect of mpg, in Model 1, in Model2) col(1) row(1)

*The Regressions
reg price mpg rep78
loc mpg1 = _b[mpg]
reg price mpg rep78 headroom
loc mpg2 = _b[mpg]

*Now write the complete row
asdocx addrow, data(on price, `mpg1' , `mpg2') col(1) row(2) dec(3)

*Another set of regressions
reg trunk mpg rep78
loc mpg1 = _b[mpg]
reg trunk mpg rep78 headroom
loc mpg2 = _b[mpg]

*Write another row
asdocx addrow, data(on trunk,  `mpg1' , `mpg2') col(1) row(3) dec(3)

*And then export to Word
asdocx export
It  produces the following output

----+---------------------------------------------
  1 |Effect of mpg         in Model 1   in Model2 
----+---------------------------------------------
  2 |on price                -271.643    -289.346 
  3 |on trunk                  -0.456      -0.303 
--------------------------------------------------

Moreover, if this is something you need frequently, you easily create a template file with the above code and use it with asdocx.