Site icon Stata.Professor : Your Partner in Research

Customized tables using option row() of asdoc – Stata

This is rather a quick example of how to use option row() of asdoc for creating highly customized tables. We are interested in a table that is given bellow.

 

*Load example dataset
sysuse auto,clear

*Write the header row of the table with table title
asdoc, row(Dependent variable:domestic or foreign, Domestic mean/frequency, Domestic SD, Foreign mean/frequency, Foreign SD, t-test) title(Summary staticis) save(myfile) replace

*Add the second row : \i, adds an empty cell
asdoc, row( Model independent variables, \i, \i, \i, \i, \i) append

*Use a loop over each variable that include price, mpg, ...
foreach var of varlist price mpg rep78 headroom trunk weight length turn
Exit mobile version