Announcement

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

  • Estout and esttab commands: How could I obtain coeficients that I am interested in ?

    Hello everyone,

    I am trying to produce a esttab table in .tex format. Basically, I want a table showing my regression coefficients, but only the coefficient on female (which is ca_sex==2), the interaction between female (ca_sex==2) and the dummy for whether the individual has children or not (children_below16 ==1 if children below 16), and finally the constant.
    Here is the code that I produced:

    Code:
    // Create table and report coefficients of interest in .tex format
    *
    eststo: quietly regress working_c19 ca_sex
    *
    eststo: quietly regress working_c19 ca_sex occupation
    *
    eststo: quietly reghdfe working_c19 ca_sex, absorb(occupation)
    *
    eststo: quietly reghdfe working_c19 ca_sex i.ca_sex##i.children_below16, absorb(occupation)
    
    esttab, coef(ca_sex children ca.sex#children_below16 _cons) ///
            label title("Regression Results")
     *
     *
     // Save the table in .tex format
    esttab using table.tex, replace
    But I obtain some coefficients (in fact a lot) that are 0.
    Is that way of coding with esttab correct?

    Thank you very much in advance.
    Best,

    Michael

  • #2
    estout is from SSC, as you are asked to explain (FAQ Advice #12). The option to keep coefficients is -keep()-. See

    Code:
    help estout

    Comment


    • #3
      Hello Andrew Musau,

      I will have a look at it.
      Thanks.

      Michael

      Comment


      • #4
        I have a question. I read the help document in stata, but I don't know how to recover my interaction variables. Here are my regressions stored:

        Code:
        *16.1. First
        regress working_c19 ca_sex
        eststo: quietly regress working_c19 ca_sex
        *
        *16.2. Second
        regress working_c19 ca_sex occupation // include occupation dummies
        eststo: quietly regress working_c19 ca_sex occupation
        *
        *16.3. Third
        reghdfe working_c19 ca_sex, absorb(occupation)
        eststo: quietly reghdfe working_c19 ca_sex, absorb(occupation)
        *
        *16.4. Fourth
        reghdfe working_c19 ca_sex i.ca_sex##i.children_below16, absorb(occupation)
        eststo: quietly reghdfe working_c19 ca_sex i.ca_sex##i.children_below16, absorb(occupation)
        and here is the code that I tried to have a table in .tex format:

        Code:
         // Save the table in .tex format
        esttab using "table_17.tex", keep(ca_sex ca_sex*children_below16 _cons) star(c 0.10 b 0.05 a 0.01) varwidth(25) interaction(" $\times$ ") style(tex) label title("Regression Results") replace
        But it gives me the following error:
        Code:
        coefficient ca_sex*children_below16 not found
        r(111);
        Could you help me please?

        Thank you in advance.

        Comment


        • #5
          Specify the -coeflegend- option to see how the interaction is labeled

          Code:
          reghdfe working_c19 ca_sex i.ca_sex##i.children_below16, coeflegend
          You should be able to refer to it as either

          Code:
          *children_below16#*ca_sex
          or

          Code:
          *ca_sex#*children_below16

          Comment


          • #6
            Hi Andrew Musau:

            Thank you so much for your help in #5!
            Best,

            Michael

            Comment

            Working...
            X