Announcement

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

  • Determining the explanatory power of an interaction term

    Hi everyone,

    I'm trying to fill a table with each line representing the explanatory power of a particular part of my model (such as fixed effects, independent variables, the residuals...), that is, the variance of this specific part divided by the variance of the model.
    Independant variables Var(xb)/Var(model)
    Fixed effect 1 Var(fe1)/Var(model)
    Residuals Var(residuals)/Var(model)
    Interaction term ?
    I am trying to find the last cell of column 2, that is, the explanatory power of an interaction term that I'd like to isolate from the predicted xb.

    So what I do is that I use the command from SSC -reghdfe- to store my fixed effects in a variable, as well as the command -predict- to save the xb and the residuals in a variable.

    Code:
    reghdfe y var1 var2 var3 i.var4##i.var5, absorb(fe1 fe2, savefe) resid
    predict xb, xb
    predict residuals, r
    Then I summarize the different variables I obtained to fill the table with my data:

    Code:
    sum xb
    display r(Var)/`variance'
    
    sum __hdfe1__
    display r(Var)/`variance'
    * __hdfe1__ is obtained with the savefe option
    with `variance' being the model's variance defined in a local previously.

    Now my problem is that xb is for all the independent variables, including the interaction term. How can I possibly isolate the variance of the different levels of the interaction term to fill the last cell of the table? My lead so far has been to generate manually a variable representing the interaction term between var4 and var5 and to put it in the fixed effect option in the regression, but it seems that the command xi generates an important quantity of variables for each combination of var4 and var5. I'm not sure this is what I want. Apologies if my post isn't clear (and it probably is!). I can explain further if needed.

  • #2
    Julia, there are at least three conceptual issues regarding your analysis.

    First, residuals contain the information of the dependent variable which the model fails to explain. The denominator of your ratio should actually be Var(dependent variable) rather than Var(model).

    Second, Var(part1)/Var(DV) and Var(part2)/Var(DV) may not be valid measures for the explanatory power of the part1 and part2, respectively. The two parts may be correlated, and the variance of one part may contain the variation from the other part. In other words, Var(part1)/Var(DV) + Var(part2)/Var(DV) may not be equal to Var(part1 and part2 together)/Var(DV). So please reconsider whether the ratios are what you want.

    Third, it's a little strange to measure the explanatory power of an interaction alone. The contribution of one factor should be calculated given other factors being constant, but it's impossible for the interaction to vary while keeping each term of the interaction constant. In your example, it makes more sense to compute the contribution of var4 alone, var5 alone, or var4 and var5 together.

    Comment

    Working...
    X