Announcement

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

  • regression: include interactions but exclude main effects

    Using Stata13 and I need to run a regression analyzing the interactions between an indicator variable (binary, 1/0), var1, and each of four continuous variables, vars2-5, but I want to exclude the main effects of all five variables. So the regression I want to run is:
    regress depvar var1*var2 var1*var3 var1*var4 var1*var5
    Can be this simplified within the regression command? Or am I better off just creating the interactions outside of the regression command? Thanks, Robert Biggert

  • #2
    Hello Robert,

    The syntax for the interactions is "c.var_name(1)##c.var_name(2)", where ## includes both effects and # only the interactions, and "c." stands for continious predictor (vs. "i." for categorical).

    Hope this helps,
    Anton

    Comment


    • #3
      Excluding the main effects, you are no longer testing for interactions - so this is probably a bad idea.

      An interaction essentially means that there is no longer one linear effect of a variable, but the effect of that variable depends on the values of other variables. Including a product term of two (or more) variables without also including the variables (Edit: and all lower order interactions), essentially models one linear effect of this product term. This is fundamentally different from an interaction as the term is commonly used.

      Technically this is possible, but I am reluctant to show (or even think about) ways to do so, unless you verify that this is really what you want and explain why this is really what you want.

      Best
      Daniel
      Last edited by daniel klein; 02 Jul 2015, 08:52.

      Comment


      • #4
        Anton: How do you exclude effects? Daniel: To move from the hypothetical of the post to the actual analysis, the data consists of US states and the indicator is a regional effect or two groups of states. The hypothesis I'm testing says the effects of the four continuous variables is only relevant in one region as opposed to the other. Robert Biggert

        Comment


        • #5
          Robert,

          Following your example above: -reg depvar c.var1#c.var2 c.var1#c.var3 c.var1#c.var4 c.var1#c.var5-

          Comment


          • #6
            Anton: Am I right in saying this could be simplified to: reg depvar i.var1 (c.var2 c.var3 c.var4 c.var5)? (Note vars2-5 are continuous.) Robert Biggert

            Comment


            • #7
              The hypothesis I'm testing says the effects of the four continuous variables is only relevant in one region as opposed to the other
              This essentially says, what I understand to be an interaction. The effect of the four variables does depend on the level of the indicator. Thus, excluding the main effects, you cannot test this hypothesis. Further this does not at all mean that the effect of one of the continuous variables depends on the effect of one (or more) of the other continuous variables. Therefore the continuous variables should not be multiplied. Instead there are 5 two-way interactions in this model, which could be written as

              \[
              y = \beta_0 + z * \beta_1 + x_1 * \beta_2 + x_2 * \beta_3 + \ldots + x_5 * \beta_6 + (z*x_1)*\beta_7 + (z*x_2) * \beta_8 + \ldots
              \]

              where \(z\) is the indicator variable and \(x_j\) are the continuous variables and the \(\beta_j\) are coefficients to be estimated.

              Technically, I would test each of the interactions separately, meaning I would estimate (at least) 5 models not put them all into one - even though theroy probably would state differently.

              Best
              Daniel
              Last edited by daniel klein; 02 Jul 2015, 09:14. Reason: screwed up the subscripts in TeX

              Comment


              • #8
                Daniel: I'm further moving from hypothetical to real and away from the original question but... To complicate this further, the actual data is a panel (48 states & 25 years). I'm primarily interested in regional effects which are clusters of states. I'm a panel regression newbie but isn't it the case that a time invariant effect such as region couldn't be included in a fixed effects model? If correct, this would preclude including the main effect of region if I'm understanding your last post. Robert Biggert

                Comment


                • #9
                  First, given this new information (again) does not change what I have stated so far.

                  Panel models do not necessarily have to be fixed-effects models - although they are preferable in a lot of situations. You are correct in assuming that the time-invariant main effect will not be included in the model. Yet, it is still possible to test for the interaction of time-invariant variables with time-varying ones. But for this test to be valid, you still need to include the main effect of the latter in the fixed-effects model.

                  (Although it seems obvious, using xtreg instead of regress to estimate panel models seems desirable).

                  Best
                  Daniel

                  Comment


                  • #10
                    Daniel: Thanks for help and hanging with this question as it migrated from the nuts/bolts of a Stata command to a more abstract one about model building. RB

                    Comment


                    • #11
                      Turning this into a panel data fixed effects problem does potentially change things quite a bit. See Jeff P's posts at http://www.statalist.org/forums/foru...fe-and-margins
                      -------------------------------------------
                      Richard Williams, Notre Dame Dept of Sociology
                      StataNow Version: 19.5 MP (2 processor)

                      EMAIL: [email protected]
                      WWW: https://www3.nd.edu/~rwilliam

                      Comment

                      Working...
                      X