Announcement

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

  • Estab - suppressing dummy with value of zero

    Hello:

    I use version 15.0 of Stata. I have made regression tables using estab that include two interactive terms between a continuous and dummy variable. For some reason, the estab table includes coefficients for when the dummy is both zero and one, even though the regular output in the Stata window does not. I would like to suppress or drop all the results for when the dummy is zero. I tried the drop command with no success.

    Here are the commands:
    logit dependentvar c.moderate_inflation_m_y##i.abe_dummy c.moderate_deflation_m_y##i.abe_dummy
    est store m1
    esttab m1, order(moderate_deflation_m_y moderate_inflation_m_y abe2 ), using "/Users/Stata/Tables/model1", se nonumber mtitle("Model 1") label varwidth(60) replace

    Here is the output for the dummies.

    Abe dummy=0 0
    (.)

    Abe dummy=1 1.874***
    (0.359)

    Abe dummy=0 # Moderate inflation 0
    (.)

    Abe dummy=1 # Moderate inflation -0.344
    (0.253)

    Abe dummy=0 # Moderate deflation 0
    (.)

    Abe dummy=1 # Moderate deflation -0.209
    (0.289)

    I'd like to get rid of all of the following from the table: "Abe dummy=0", "Abe dummy=0 # Moderate inflation", "Abe dummy=0 # Moderate inflation". Is there any way to do this?

    Thank you,
    Gene Park

  • #2
    Have you tried help esttab? For any command, this should be your first stop before moving to some other place.

    nobaselevels drops base levels of factor variables (only relevant in Stata 11 or newer).
    drop(droplist) identifies the coefficients to be dropped from the table.

    Code:
    esttab m1, nobaselevels
    */ or
    esttab m1, drop(0.abe_dummy ... )

    Comment


    • #3
      That did it. Thank you so much, Andrew. I'll try the help command in the future.

      Comment


      • #4
        Originally posted by Andrew Musau View Post
        Have you tried help esttab? For any command, this should be your first stop before moving to some other place.




        Code:
        esttab m1, nobaselevels
        */ or
        esttab m1, drop(0.abe_dummy ... )
        Hello Andrew,

        I have the same problem as the original poster, but unfortunately, your suggested solution does not seem to work in Stata 18. The nobaselevels is not listed in the help file.
        Here is an excerpt from my output,

        Code:
        --------------------------------------------
                              (1)             (2)  
                           action           action
        --------------------------------------------
        0bn.T_C                 .               .  
                                .               .  
        
        1.T_C             0.00147          0.0389  
                         (0.0586)        (0.0556)  
        
        1bn.return~b            .               .  
                                .               .  
        1bn.round               .               .  
                                .               .  
        
        2.round            0.0446          0.0516  
                         (0.0467)        (0.0459)  
        
        1bn.format                              .  
                                                .  
        
        3.format                            0.409**
                                          (0.132)
        I tried
        Code:
         esttab,se r2 nobaselevels
        but received the error option nobaselevels not allowed
        r(198);

        I would be most grateful for your advice as I couldn't find a solution to my problem.

        Thank you very much, and kind regards!

        EDIT: I also tried to drop the base dummies using
        Code:
        esttab,se r2 drop(0bn.T_C 1bn.return~b 1bn.risk 1bn.round 1bn.format)
        however, received the error message coefficient 1bn.return~b not found even though it is clearly in the regression..
        Last edited by Mary Burckhette; 12 Oct 2023, 03:09.

        Comment


        • #5
          You need to present a reproducible example that one can run. You may try:

          Code:
          esttab,se r2 keep(1.T_C 2.round 3.format)

          Comment


          • #6
            Hello Andrew,

            Thank you very much for your code. It works! Unfortunately, my regressions have a lot of indicator variables as independent variables. Is there any other way to suppress the base levels automatically instead of manually adding the ones I want to keep?

            Thank you very much for your assistance!

            Kind regards!

            Comment


            • #7
              As I said, provide an example that reproduces the issue as this is not a general problem.

              Comment

              Working...
              X