Announcement

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

  • How to attach the lincom output to outreg2 table after SUR estimation

    Hello everyone,

    I am estimating a multivariate model using "mysureg" command and need to add the results of a linear combination ("lincom b0+b1+b2") of some of the coefficient in each equation to my output.I tried the "addstat" option of the outreg2, but since I have a multivariate model it did not help me, because I have several results to include in the output from outreg2. please let me know if you know how I can do this. Thanks

  • #2
    Over 6 years too late but the outreg2 documentation includes an example of this that largely worked for me.


    To add results of lincom postestimation command to a table:

    Code:
    sysuse auto, clear
    reg price mpg rep78 head
    lincom mpg + rep
    local tstat=r(estimate)/r(se)
    local pval = tprob(r(df), abs(`tstat'))
    outreg2 using "myfile", adds(joint, r(estimate), t-stat, `tstat', p-val,`pval') replace see
    I modified this slightly to include significance stars - I am sure there is a more succinct way of doing this:

    Code:
         local jtest=round(r(estimate), 0.001)
         local se=round(r(se), 0.001)
    
         if `pval'<=0.1 {
             local star  "*"
         }
         if `pval'<=0.05 {
             local star "**"
         }
         if `pval'<=0.01 {
             local star  "***"
         }
         else {
             local star  " "
         }
    
         local jstat = "`jtest'`star'"
    Then had to addtext instead of addstat because addstat did not round or add significance stars

    outreg ... , addtext (Joint, "`jstat'", SE, "`se'")

    Comment


    • #3
      I wanted to get the significance star of LINCOM test in my regression table. I was able to get the coefficient, SE, t-stat, and p-value. However, I am not able to get the significant stars. I used code provided by Henry Cust above but I am getting error message <=0.1 invalid name using this code.
      if `pval'<=0.1 { local star "*" } Any help is appreciated.

      Comment


      • #4
        Do you have the if `pval'<=0.1 { local star "*" } over 3 lines?

        i.e.

        if `pval'<=0.1 {
        local star "*"
        }

        Comment

        Working...
        X