Announcement

Collapse
No announcement yet.
X
  • 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:
    Code:
    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 ///
    Code:
    outreg2 using Summ.doc, sideway sum(log) eqkeep(N mean sd min max) replace dec(2)
    Here in
    Code:
    outreg2
    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.

    Thanks,

    Ritika

  • #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:
    Code:
    * 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


    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 Dr. Shah that was helpful.

      Comment


      • #4
        Please do not forget to cite asdoc.
        You may also like asdocx, that is a more advanced version of asdoc.
        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


        • #5
          Originally posted by Attaullah Shah View Post
          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:
          Code:
          * 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

          Hi Dr Shah,

          How can one use the "asdoc sum" command with categorical variables.

          Thank you,

          Trust

          Comment


          • #6
            Use factor notation of i.
            See this example
            Code:
            sysuse auto
            asdoc sum i.foreign, replace
            
                Variable |        Obs        Mean    Std. Dev.       Min        Max
            -------------+---------------------------------------------------------
                 foreign |
               Domestic  |         74    .7027027    .4601885          0          1
                Foreign  |         74    .2972973    .4601885          0          1
            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

            Working...
            X