Announcement

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

  • Appending regression tables with the outtex command

    Hi All,

    I have data that resembles the following.

    Code:
    * Example generated by -dataex-. To install: ssc install dataex
    clear
    input float(y x1 x2)
     32  2 12
      2  1  3
      1  2  2
    123 32 21
    123 41 12
     12  3  2
     21  2  2
    123  2 21
    123  2  2
    123  2 21
    end

    In the above, I have a regressand y, and 2 regressors, x1 and x2. I wish to run univariate regressions separately- i.e. run a regression of y on x1 and x2 separately. After each regression, I wish to use the outtex command. For instance, I wish to use:

    Code:
    reg y x1
    outtex, labels level detail legend key(stab)
    Now, instead of presenting the results separately, I wish to append the first table, with the second, as the rows of the separate tables will depict the same things (coefficient, Standard error, t stats, Number of observations, R2). I know that outreg permits appending tables, but I am not able to find how to do this with outtex. Any help is much appreiciated.

    Best,
    CS






  • #2
    While someone might be able to help you with outtex, I shall present a solution with asdoc. You mentioned to present the regressions results on separate rows, therefore, the relevant option using asdoc is option wide [See other options in post 38 in this thread].
    Code:
    ssc install asdoc
    asdoc reg y x1, replace wide stars t(below)
    asdoc reg y x2,  wide stars t(below) end
    . The Table produced by asdoc is given below
    Click image for larger version

Name:	wide.png
Views:	1
Size:	15.2 KB
ID:	1469885


    Explanations:
    wide: This option reports each regression on a separate row
    stars: Reports significance level with asterisks
    t(below): reports the t-statistics below the regression coefficients
    end: Using option end, asdoc will add the following text after the last row of the table.
    a. If option t() is used, then the text "t-statistics are in parenthesis" will be added.
    b. If option se() is used, then the text "Standard errors are in parenthesis will be added."
    c. If option stars is used, then the text "*** p<0.01, ** p<0.05, * p<0.1 will be added."
    If option end is not used, asdoc will still report complete table, however, the above text will not be added to the end of the table.

    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
      Attaullah Shah Thanks a lot! This works well.

      Comment

      Working...
      X