Announcement

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

  • drop i.* controls in -outreg2-

    Dear all,

    I do regressions of the form
    - reg y x i.control-
    to control for the 5 categories of "control"
    as well as in another context
    - reg y i.x#i.control-
    to control for the interactions of the 5 different categories of "control" and the 4 different categories of x.

    Afterwards I use -outreg2-
    Now the coefficients on the different categories of "control", which Stata labels in some pattern whose logic I do not fully follow, are not of interest to me.
    However, when I add to -outreg2- the option "drop(i.control)" or "drop(i.*)" that has no effect.

    What do I need to specify instead to drop these coefficients?

    Thank you so much and all best,
    JZ

  • #2
    Jen:
    did you try:
    Code:
    drop control
    ?
    As an aside, I realize that, in your second code, you omitted the "main" effect of -x- and -control-.
    As it is quite unusual to omit those effects, you might want to rephrase your second code as follows:
    Code:
    reg y i.x##i.control
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you. Somehow -drop(control)- does not do the job, no clue why?

      Thank you for the aside though, that's a fair point.

      Best regards,
      JZ

      Comment


      • #4
        Jen:
        try the suggested without brackets.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Use the i.var in your outreg command

          Code:
          sysuse auto, clear
          reg price weight i.foreign
          outreg2 using myfile, drop(i.foreign) replace
          ....which is what you appear to say in post #1, I see. It drops the variables when I do above code, though. What else is wrong? What code are you using exactly?
          Last edited by Jorrit Gosens; 22 Feb 2016, 07:52.

          Comment


          • #6

            I understand from your question that you are using the interaction terms just as controls. If your goal is to keep only certain specific variables from your model in the table produced by outreg2 it might be better to use the option keep instead of drop.

            Code:
            webuse nhanes2.dta
            reg  bpsystol i.sex##i.race  age height weight
            outreg2 using table1, excel replace  keep(age height weight)
            However, it would help if you explained what you are trying to estimate and the exact results you want to display in your table. Show us your code as well.

            Comment

            Working...
            X