Announcement

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

  • Stata overrides the command for which level to omit in a regression

    Hi Statalist,

    I would like to seek help for a problem I encountered. I tried to estimate a regression where I regress outcome variable IHS on factor variable Chinese_event (I chose 7 as the base period) and Stata did use 7 as the base period. However, when I tried to add an interaction between the factor variable Chinese_event and a continuous variable std_repub_share, I also specified 7 as the base period, Stata did not omit period 7. I have tried to use io7.Chinese_event. It still did not work. Please see the output below. what should I do? I appreciate any suggestions!

    reg IHS ib7.Chinese_event ib7.Chinese_event#c.std_repub_share

    Attached Files
    Last edited by Austin Yi; 23 Feb 2022, 17:23.

  • #2
    Please reformat this so I can work with the same subset of the dataset.

    Use dataex to show your data, not like this.

    Comment


    • #3
      Originally posted by Jared Greathouse View Post
      Please reformat this so I can work with the same subset of the dataset.

      Use dataex to show your data, not like this.
      My apology! I am quite new to Statalist, I have some troubling using the tool you mentioned. I attached a picture of the output, will it help? Sorry for the inconvenience.

      Comment


      • #4
        This problem often arises if you are omitting a main effect involved in an interaction. In your case, you are not including "c.std_repub_share". Doing this will likely result in a misspecified model. To get main effects and interactions, you want:

        Code:
        reg IHS ib7.Chinese_event##c.std_repub_share

        Otherwise, if you are sure about your specification, I have elsewhere made the point that the omission operator should be distributed to all elements involved in the interaction. See https://www.statalist.org/forums/for...nuous-variable
        Last edited by Andrew Musau; 23 Feb 2022, 18:40.

        Comment


        • #5
          Originally posted by Andrew Musau View Post
          This problem often arises if you are omitting a main effect involved in an interaction. In your case, you are not including "c.std_repub_share". Doing this will likely result in a misspecified model. To get main effects and interactions, you want:

          Code:
          reg IHS ib7.Chinese_event##c.std_repub_share

          Otherwise, if you are sure about your specification, I have elsewhere made the point that the omission operator should be distributed to all elements involved in the interaction. See https://www.statalist.org/forums/for...nuous-variable
          Hi Andrew, thanks for the reply!! std_repub_share is a continuous variable, if I need to specify that it is continuous and also specify the omission operator, does it look like this:
          co.std_repub_share

          Comment


          • #6
            You just include the omission operator:

            Code:
            reg IHS ib7.Chinese_event i.Chinese_event#c.std_repub_share o7.Chinese_event#o.std_repub_share

            Comment


            • #7
              Thank you!! Do you know the difference between using the omission operator o and using the base operator b in this context?

              Comment


              • #8
                As I said in #4, you are causing the issue by omitting a main effect. Then you are forced to omit the "base" category manually using the omission operator. In reality, such a base is only relevant (and can be called so) in the presence of the main effects --- that is why I place quotation marks around the word in this instance.

                Comment


                • #9
                  Originally posted by Andrew Musau View Post
                  As I said in #4, you are causing the issue by omitting a main effect. Then you are forced to omit the "base" category manually using the omission operator. In reality, such a base is only relevant (and can be called so) in the presence of the main effects --- that is why I place quotation marks around the word in this instance.
                  It makes sense! I just wondering in general, if I want to omit one level of a factor variable, say cat == 2, are "ib2.cat" and "o2.cat" different in practice? Thanks for your time for helping me with these nuances. I appreciate it!

                  Comment


                  • #10
                    Originally posted by Austin Yi View Post
                    if I want to omit one level of a factor variable, say cat == 2, are "ib2.cat" and "o2.cat" different in practice?
                    The result is the same if combined with a specification of no-base level, i.e.,

                    Code:
                    ibn.cat o2.cat
                    is equivalent to

                    Code:
                    ib2.cat

                    Otherwise, you can omit a level and Stata still proceeds to choose a base level in the absence of the omitted level. You should use the latter so that you do not run into problems with post-estimation commands such as margins.
                    Last edited by Andrew Musau; 24 Feb 2022, 11:36.

                    Comment


                    • #11
                      Thanks a lot!! it really helped me!

                      Comment

                      Working...
                      X