Announcement

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

  • indicate or add individual fixed effect/ year fixed effect using the command -esttab- -estadd

    Hello everyone,
    I have some trouble while using properly the command estadd.
    I want a row at the bottom of the table that indicates "Yes" or "no" for the individual fixed-effect/ year fixed effect and another one that indicate if or not my estimation is robust.
    Thus, I need help to identify the mistakes in my code.
    I use a nlswork.dta as a database in this example.

    what I get:

    -----------------------------------
    (1) (2)
    ttl_exp ttl_exp
    --------------------------------------------
    age -0.00861 -0.00861
    (0.0506) (0.0618)

    ind_code -0.0427*** -0.0427***
    (0.00523) (0.00897)

    occ_code -0.0330*** -0.0330***
    (0.00543) (0.00806)

    _cons 1.171 1.171
    (0.968) (1.187)
    --------------------------------------------
    indivudal ~s
    year fixed~t 28081 28081
    --------------------------------------------
    Standard errors in parentheses
    * p<.10, ** p<.05, *** p<.01

    What I want:

    --------------------------------------------
    (1) (2)
    ttl_exp ttl_exp
    --------------------------------------------
    age -0.00861 -0.00861
    (0.0506) (0.0618)

    ind_code -0.0427*** -0.0427***
    (0.00523) (0.00897)

    occ_code -0.0330*** -0.0330***
    (0.00543) (0.00806)

    _cons 1.171 1.171
    (0.968) (1.187)
    --------------------------------------------
    N 28081 28081
    indivudal ~s Yes yes
    year fixed~t Yes yes
    Robust no yes
    --------------------------------------------
    Standard errors in parentheses
    * p<.10, ** p<.05, *** p<.01



    Code:
    eststo clear
    use http://www.stata-press.com/data/r13/nlswork
    xtset idcode year
    eststo: xtreg ttl_exp age ind_code occ_code i.year ,fe
    estadd local individual "yes"
    estadd local year "yes"
    estadd local robust "no"
    eststo: xtreg ttl_exp age ind_code occ_code i.year ,fe robust
    estadd local individual "yes"
    estadd local year "yes"
    estadd local robust "yes"
    esttab ,  s(fixed N, label("indivudal fixed effects" "year fixed effect" "Robust")) ar2 se noconstant star(* .10 ** .05 *** .01) drop(*year)
    Thank you
    Last edited by DORRA SELLAMI; 18 Jul 2017, 07:10.

  • #2
    Cross-posting of https://stackoverflow.com/questions/...the-command-es

    Please note our policy on cross-posting, which is that you should tell us about it. FAQ Advice #8

    Comment


    • #3
      Hi everyone, I am running into the same problem as Dorra. I am not being able to include more than a single Fixed Effects line at the bottom when I use esttab / estout. Does anyone have the solution for this?

      Comment


      • #4
        The issue in #1 is to do with how the stats() are indicated in the esttab command.

        Code:
        eststo clear
        use http://www.stata-press.com/data/r13/nlswork
        xtset idcode year
        eststo: xtreg ttl_exp age ind_code occ_code i.year ,fe robust
        estadd local individual "yes"
        estadd local year "yes"
        estadd local robust "yes"
        esttab ,  s(N individual year robust , label("N" "Indivudal fixed effects" "Year fixed effect" "Robust standard errors")) ar2 se noconstant star(* .10 ** .05 *** .01) drop(*year)
        Results:

        Code:
        . 
        . esttab ,  s(N individual year robust , label("N" "Indivudal fixed effects" "Y
        > ear fixed effect" "Robust standard errors")) ar2 se noconstant star(* .10 ** 
        > .05 *** .01) drop(*year)
        
        ----------------------------
                              (1)   
                          ttl_exp   
        ----------------------------
        age              -0.00861   
                         (0.0618)   
        
        ind_code          -0.0427***
                        (0.00897)   
        
        occ_code          -0.0330***
                        (0.00806)   
        
        _cons               1.171   
                          (1.187)   
        ----------------------------
        N                   28081   
        Indivudal ~s          yes   
        Year fixed~t          yes   
        Robust sta~s          yes   
        ----------------------------
        Standard errors in parentheses
        * p<.10, ** p<.05, *** p<.01

        Comment


        • #5
          Andrew Musau
          Unfortunately, I have faced the same issue as the original issue. When I run your code, the results look like the below. At the bottom, there is only one "yes". Can anybody give me a hint to fix this?


          ----------------------------
          (1)
          ttl_exp
          ----------------------------
          age -0.00861
          (0.0618)

          ind_code -0.0427***
          (0.00897)

          occ_code -0.0330***
          (0.00806)

          _cons 1.171
          (1.187)
          ----------------------------
          N 28081
          Indivudal ~s yes
          Year fixed~t
          Robust sta~s
          ----------------------------

          Comment


          • #6
            Code:
            ssc install estout, replace

            Comment


            • #7
              Andrew Musau Thanks! It works well after re-installing it.

              Comment

              Working...
              X