Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Nice export STATA output to excel or word

    Dear Madam/Sir,

    I used the following command using posts here, but tables are broken both in MS word and in MS excel. Could you please help me to have nicer and more organized tables?


    asdoc univar ln_change_sga ln_change_cogs ln_change_emp ln_change_sale ln_bw uncertain gdprate sec_dec asset_int EMP_int if e(sample), save(ds1.doc) replace
    asdoc univar ln_change_sga ln_change_cogs ln_change_emp ln_change_sale ln_bw uncertain gdprate sec_dec asset_int EMP_int if e(sample), save(ds1.xls) replace

    Thanks
    Joon

  • #2
    univar is from STB-51 sg67_1, which you should mention for readers.
    Since this is not a Stata official command, therefore, asdoc does not have any specific routine for it. The help file of univar shows that it reports summary statistics, with some additional statistics. Therefore, you can use the stat() option of asdoc with sum command, instead of using the univar command, (see help file of asdoc, section 2.3 Custom summary statistics). Here is the output from the univar and asdocx, stat() for comparison.

    Code:
     univar capital equity surplus
                                            -------------- Quantiles --------------
    Variable       n     Mean     S.D.      Min      .25      Mdn      .75      Max
    -------------------------------------------------------------------------------
     capital    5035   526.05  3126.67     1.50    50.00   100.00   192.00 51000.00
      equity    5035  1126.76  5265.64 -3.4e+04    42.90   221.50   602.00  1.1e+05
     surplus    5035   600.71  3095.50 -5.4e+04   -14.90    98.70   384.40 62051.50
    -------------------------------------------------------------------------------
    Now with asdoc

    Code:
    asdoc sum capital equity surplus, stat(N mean sd min p25 p50 p75 max) replace
    Click image for larger version

Name:	Capture.PNG
Views:	1
Size:	22.4 KB
ID:	1639073



    asdocx is now available
    A more powerful and flexible version of asdoc is now available. I call it asdocx. You may like to check the details here

    https://fintechprofessor.com/asdocx


    Please do remember to cite asdoc. To cite:

    In-text citation
    Tables were created using asdoc, a Stata program written by Shah (2018).

    Bibliography
    Shah, A. (2018). ASDOC: Stata module to create high-quality tables in MS Word from Stata output. Statistical Software Components S458466, Boston College Department of Economics.




    Last edited by Attaullah Shah; 01 Dec 2021, 23:23.
    Regards
    --------------------------------------------------
    Attaullah Shah, PhD.
    Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    FinTechProfessor.com
    https://asdocx.com
    Check out my asdoc program, which sends outputs to MS Word.
    For more flexibility, consider using asdocx which can send Stata outputs to MS Word, Excel, LaTeX, or HTML.

    Comment


    • #3
      Thank you so much, Dr. Shah. Your command code is very useful. Have a nice day.
      Joon

      Comment

      Working...
      X