Announcement

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

  • Descriptive Statistics per Country - STATA to Work-Output

    Hi,

    I have started to work on my data do-file for my thesis I managed to run the commands I need and export the regression tables to word. However, I struggle with the Word-output for the descriptives statistics per country. I want to build a table like the example below. However, I haven't succeeded. Either the word-output is completely empty, the countries are next to each other rather than in rows, and so on ...
    Country Absolute Number of Observations per Country Relative Number of Observations per Country Variable 1 Variable 1 Variable 2 Variable 3 Variable 4
    Mean SD Median Median Median
    AT 20 20%
    AU 55 55%
    BE 15 15%
    BG 20 20%
    Total 100 100%
    Variable 1 is main dependent variable which is on firm-level. I'd like to show mean and sd for this one. Variable 2, 3, and 4 are country-level variables which hardly change (that's why I use the median).

    In case it is not possible to do mean, sd and median in the same table, but for different variables. I would also appreciate two separate tables (one with variable 1, one with variable 2, 3, and 4)

    Here is some code I have tried so far.
    Code:
    eststo clear
    estpost tabstat VARIABLES, by(GGISO) statistics(count mean sd) columns(statistics)
    esttab using Summary.rtf, ///
            append ///        
            noobs ///
            unstack ///
            nonumbers ///
            nolz ///
            nomtitle ///
            coeflabel(VARIABLES and LABELS) ///
            b(%9.2f) ///
            title ("Summary Statistics - Country")
    eststo clear
    Thank you very much!

  • #2
    Consider using asdoc.
    Code:
    ssc install asdoc
    bys GGISO : asdoc sum VARIABLES, stat(N mean sd) 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
      Hi

      Thank you for your response! I have tried asdoc. But it doesn't give me the table I'd like to have. asdoc lists the variables in rows and not in columns. Do you have any other idea?

      Kind regards

      Comment


      • #4
        You copy the table from Word and transpose it in Excel.
        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
          Well, that would work for each country individually as your code creates one table for each country. So I'd have to do plenty of manual work which I'd like to avoid :P

          Code:
          asdoc tabstat FirmYears VARIABLES, statistics(p50) by(GGISO) columns(variables)
          I figured that the above code gives me the absolute number of observations and the median of all variables. But also, this code is not exactly what I want to do.

          Comment

          Working...
          X