Announcement

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

  • How to combine the putexcel with significance symbol star

    Dear all,

    I would like combine the putexcel code with significance symbol star(*** ** *).

    Does anyone know how to yield style B instead of style A in using putexcel code?


    putexcel B4=(_b[X1])

    putexcel B5=(_b[X1]/_se[X1])


    Click image for larger version

Name:	put to excel.jpg
Views:	1
Size:	31.8 KB
ID:	1414400


    Last edited by Eric Li; 12 Oct 2017, 23:14.

  • #2
    Eric,

    You will have to create the number with the significance symbol yourself before using putexcel. For example,

    Code:
    sysuse auto, clear
    regress mpg weight turn
    local coeff = _b[turn]
    local coeff : display %5.3f `coeff' . "***"
    putexcel set test, replace
    putexcel A1 = "Coeff"
    putexcel B1 = "`coeff'"

    Comment


    • #3
      Hi Kevin,
      Is the only way to do this manually, i.e., individually for each coefficient? That seems really cumbersome! Is there a way to automate the process?
      Thanks and best,
      Wameq

      Comment


      • #4
        asdoc can be used to export regression tables in three different styles. The one that matches the Stata output is the detailed regression table. For example, the following one line of code will generate the given table.
        Code:
        * Install asdoc
        ssc install asdoc
        
        * Load example data set
        sysuse auto, clear
        
        * Estimate the regression and send it to MS word in one click
        asdoc reg price mpg rep78 headroom trunk weight length turn , replace

        You can read this blog post for more examples and variations http://fintechprofessor.com/2018/12/...ing-stars-etc/
        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
          Not to take anything away from asdoc, but estout (SSC, written by Ben Jann, some info on his website) is also a good program. Exporting a matrix of correlation coefficients is easier to do in putexcel than in estout, and there are probably some other edge cases (especially for commands that don't write to e(b) and e(V)).
          Be aware that it can be very hard to answer a question without sample data. You can use the dataex command for this. Type help dataex at the command line.

          When presenting code or results, please use the code delimiters format them. Use the # button on the formatting toolbar, between the " (double quote) and <> buttons.

          Comment


          • #6
            Dear Weiwen Ng I have not used estoutmyself, I think estout produces a summarized table of regression. If that is true, then asdoc differs from estout in a sense that asdoc offers three different types of regression tables.
            1. Detailed regression tables, like the one shown in the #2 above
            2. Nested regression tables such as those produced by the estout and outreg2
            3. Wide regression tables (good for regressions over groups)

            some video examples are here
            https://www.youtube.com/watch?v=rkUU7UiygBU
            https://www.youtube.com/watch?v=61ks3cMPz3c
            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