Export browse window to MS Word using Stata asdoc

187 views Asked by At

How can I export the contents of the Stata browse window to MS Word? I'm currently using the asdoc command. However, any method outside "copy and paste" is acceptable.

my attempt

ssc install asdoc, replace
sysuse auto

asdoc, row( make, price, mpg, rep78, headroom, trunk, weight, length, turn, displacement, gear_ratio, foreign ) title(Test Table)

2

There are 2 answers

0
24thDan On BEST ANSWER

You can use the code below to export the current dataset or its subsets to MS Word

ssc install asdoc, replace
sysuse auto
asdoc list make price mpg rep78 headroom trunk weight length turn displacement gear_ratio foreign in 1/10 , replace

to export without inputting the variable names

asdoc list * in 1/10 , replace

and to export the entire dataset, simply remove the in

asdoc list * , replace
0
Nick Cox On

The contents of the browse window are just the current dataset, or whatever subset you specify.

Minimally, you may considering using an export command to create a dataset file.

For any output to be readable by MS Word, much hinges on what you might be willing to do without, or other way round, your unstated criteria on what file you expect to be produced.

The following are among details to think about:

  1. browse respects display formats, which do not have to match the precision with which Stata holds data.

  2. browse by default shows value labels when defined. You may wish to export values and value labels.

  3. browse may have difficulty showing very long strings.

  4. The dataset may include objects not shown in the browse window, such as characteristics.