Announcement

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

  • Esttab: Drop factor variables in regression output

    I would like to drop some factor variable coefficients in my regressions, since they are mere controls. I checked the manual ("drop(list) drop individual coefficients") but could'nt find how to handle factors here.

    Code:
    * OLS regression without factor variable
    sysuse auto, clear
    regress price weight mpg rep78 foreign
    esttab, drop(rep78) // this drop is fine
    
    * OLS regression with factor variable
    sysuse auto, clear
    regress price weight mpg i.rep78 foreign
    esttab, drop(rep78) // not working, how to drop factor coefficients in regression table?
    esttab, drop(i.rep78) // not working
    esttab, drop(`rep78') // not working
    Thank you.

  • #2
    Dear Marco, Is this what you wanted?
    Code:
    * OLS regression with factor variable
    sysuse auto, clear
    regress price weight mpg i.rep78 foreign
    esttab, drop(*.rep78)
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

    Comment


    • #3
      Great, that's what I was looking for.

      Comment


      • #4
        n
        Last edited by Marine Jouvin; 30 Jun 2022, 07:08.

        Comment


        • #5
          Originally posted by River Huang View Post
          Dear Marco, Is this what you wanted?
          Code:
          * OLS regression with factor variable
          sysuse auto, clear
          regress price weight mpg i.rep78 foreign
          esttab, drop(*.rep78)
          If I do this, how can I reference the (*.rep78) in the "indicate()" command? Because I get an error if I do it like this. However I want a line saying RepYear dummies included.



          EDIT:
          Found my mistake myself. You are not allowed to shorten any varnames in indicate.
          Last edited by Gracia Brueckmann; 04 Nov 2022, 05:08.

          Comment


          • #6
            Code:
            indicate("Repair record dummies = *.rep78")
            will automatically omit those dummies from the table. No need to drop them.

            Comment

            Working...
            X