Announcement

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

  • Interaction terms

    Hi all,
    I would like the run the following regression in Stata:

    Y(s,c,t) = constant + beta1*x1(c,t)*x2(s,t) + gamma1*C*S + gamma2*C*T + gmma3*S*T + error

    where s is state, c is county and t is time. C*S, C*T and S*T are double-interaction fixed effects. My goal is to identify the impact of x2(s,t) on Y(s,c,t), using the interaction terms with beta1.

    The variable of interest is beta1, but both x1 and x2 vary across both county-time and state-time. Is this specification problematic?

    Thank you in advance
    Can



  • #2
    Cav:
    welcome to the list.
    I find your notation weird.
    You probably omitted beta2 and i'm not sure what you mean by -gamma- (is it not a coefficient, too)?
    Besides, you do not say which kind of regression are you going to perform (as it depends on your dependent variable). A linear one, a logistic one or a Poisson one (just to mention a few)?
    That said, you would be better off by taking a look at -help fvvarlist- and reading the FAQ to learn how to post more effectively. Thanks.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Hi Carlo thank you for your reply.
      This is a simple OLS regression with three sets of double interaction fixed effects (with coefficients: gamma1, gamma2, gamma3) and an interaction term (with coefficient: beta1).
      I am interested in estimating beta1, but my concern is the following:

      x1 varies with county and time (c,t); and x2 varies with state and time (s,t).
      The dependent variable Y varies with county, state and time (c,s,t).

      Is there a problem in this specification?

      Best
      Can


      Comment


      • #4
        Can:
        I'm still unclear with what you're after.
        That said, I see no problem in your specification.
        However, some concerns may arise about:
        - are you sure that you're going to estimate a fixed effect regression model? You're seemingly dealing with a panel dataset that you want to manage as an OLS without clustered standard errors on panelid (at the risk of producing biased estimates, as, under OLS, you treat all the observations as they were independent, which is not the case with panel data regression model; I would switch to -xtreg, fe- instead;
        - under -fe- specification, time-invariant predictors are ruled out from the right-hand side of the regression equation (due to demeaning) and time-variant predictors should differ across years to get interesting estimates (where interesting is not a synonim for statistical significant)..

        I would recommend you to take a look at -fvvarlist-, rewrite your code accordingly, try your code and post on the list what you typed and what Stata gave you back.
        Kind regards,
        Carlo
        (Stata 19.0)

        Comment


        • #5
          Dear Carlo,
          thank you for your quick reply. It is very useful. I will try that.
          So, having an interaction of x1 and x2 is not a problem. I had this concern since both x1 and x2 change in two dimensions, and y varies in three dimensions.

          I mean, both terms in interaction vary with time. This ws my concern.

          Best
          Can

          Comment


          • #6
            Can:
            your concern should be conditional on the specification you're going to use, which brings about another (more) substantive issue. -xtreg, fe- focuses on the variance within the same panel, whereas -xtreg, re- focuses on the variance between different panels.
            However, both specifications can estimate coefficients for time-varying predictors.
            My advice is to look at what Stata gave you back after your code, just to check that what you typed is what you have in mind (weird as it seems, sometimes it s not).
            You can also benefit enormously from two Stata built-in commands, such as -margins- and -marginsplot- (warning: you shouls use the -fvvarlist- notation to feed them).
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment

            Working...
            X