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

  • Exporting descriptive statistics table

    Hi all,

    I have a question related to exporting summary statistics table. I have been outreg2 to export summary statistics table until now. But my problem is I want only selected variables to be exported in the table. However, outreg2 exports all the variables on the list.

    Commands that I use are:
    summ lpcincome dukeenergy gulfpower municipal solarresource pyamd4 lpopden age ///
    p2000_later p55orabove larea lnsales lpcper ofdemocracts ofrepublicans sjobs ///
    areainsqmiles morethan1unit pcadval unitdetached estab coast umploymentrate ///
    outreg2 using Summ.doc, sideway sum(log) eqkeep(N mean sd min max) replace dec(2)
    Here in
    even if I mention list of variables that I want it still exports all the variables.

    I tried other commands like esttab and estpost but it doesn't export variables.

    Is there a way to export only selected variables?

    Looking forward to hearing from one of the members.



  • #2
    You can use asdoc (from SSC) for exporting :
    1. Default descriptive statistics
    2. Detailed descriptive Statistics
    3. Customized descriptive statistics
    4. Descriptive statistics for all variables
    5. Descriptive statistics for only selected variables

    This YouTube video explains these in detail. Following are some additional examples.

    See the following examples:
    * install asdoc
    ssc install asdoc
    * use auto data 
    sysuse auto, clear
    * Default statistics for all variables
    asdoc sum, replace
    * Default statistics for selected variables
    asdoc sum price mpg trunk, replace
    * Detailed statistics for all variables
    asdoc sum, detail replace
    * Detailed statistics for selected variables
    asdoc sum price mpg trunk, detail replace
    * Customized statistics
    asdoc sum price mpg trunk, stat(N mean sd min max skewness ) replace

    Attaullah Shah, PhD.
    Associate Professor of Finance, Institute of Management Sciences Peshawar, Pakistan
    If you use MS Word, do check my asdoc program that easily sends Stata output to MS Word


    • #3
      Thank you Dr. Shah that was helpful.