Announcement

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

  • Interaction term between categorical and continuous

    Dear Statalisters,

    I would like to include an interaction term between categorical and continuous variables in my model as explanatory variables.
    (The categorical variable has 20 categories)

    The following is what I want to estimate:

    Code:
    xtreg y ib(first).categorical#c.continuous, fe
    The problem is that my intended base category is still included in the estimation results!


    I also tried full factorial interaction and got estimation results without base category (as intended).

    Code:
    xtreg y ib(first).categorical##c.continuous, fe
    However, I do not want to use full factorial interaction since it causes too many variables to be included in the model and I barely get significant coefficients.


    My question is, is it still okay to use my first approach? (model with no base category)
    Or is it better to use full factorial interaction terms even if I get results with little significance?

    Any comment will be greatly appreciated.

  • #2
    Hi Hyeseon Shin
    Deciding which approach is the best really boils down to
    a) what do you think is happening in your data
    b) what can you test regarding to what you think.
    Setting aside the fixed effects, when you interact a categorical variable with a continues one (say i.sex#c.age). You are implicitly saying that the constant /intercept is the same for both men and women, and that the only difference is the slope. If you were to add -age i.sex#c.age) then the same interpretation applies, but the interaction will capture the difference in the slope for women.
    In the second case, what you are doing is as follows (i.sex c.age i.sex#c.age) which basically means are letting the constant to vary across sex.
    So, is the first approach correct? Yes, if what you want are the different slopes for each category (not difference respect to a base category) and you assume the intercept does not change across categories.
    What about the full interaction? I think this is better, if you are uncertain about the full set of effects, and you do not want to make assumptions like "the intercept does not change across categories"
    HTH
    Fernando

    Comment


    • #3
      Dear Fernando Rios,

      Thank you for your kind explanation.
      Now I understand that the inclusion of a base category is not a big deal.

      Actually, I simplified my model in the first post and what I am really struggling with is a triple interaction term:
      i.macroshock(yes or no) # i.industry (20 categories) # c.continuous

      In my research, I want to observe the heterogeneous effects of a continuous variable across industries especially when there is a macroeconomic shock.

      And the model I want to analyze is
      Code:
      xtreg  y  c.continuous  i.macroshock#ib(first).industry#c.continuous  i.macroshock  i.subindustry, fe

      If I use full factorial interaction, then there are more than 80 variables generated, thus the results are mostly not significant.
      This is why I am trying to avoid using full factorial interaction terms.

      I would like to know if my above approach(with extra categorical dummies allowing different intercepts) is appropriate.

      Thank you in advance.
      Hyeseon Shin

      Comment

      Working...
      X