I wish to produce frequency tables along with inferential statistics for export into MS Word, and would like the stats to appear immediately below the tabulated data. For example, the following code produces a table followed by chi-square stats in the Stata Results window, but only the table appears in the generated (or appended) Word document:
asdoc tab gender q14_1, row chi2
In the Stata results window but not the Word doc, the following output follows the table: Pearson chi2(4) = 21.7637 Pr = 0.000
Is there coding I could use that would produce a Word doc with the frequency table followed by the chi-square stats (i.e., a .doc with output identical to the output displayed in the Results window)?
(My intention is to produce a large number of similar tables using a foreach loop, so manual copying and pasting of the chi-square results to the Word doc would be inefficient.)
Also, how might I display percentages with only one decimal point in the Word doc table? Adding the option ‘dec(1)’ to the code does not achieve this.