Announcement

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

  • Help with understanding country-specific time trends

    Hi all,

    I am running a regression using data on individuals from different countries. All variables vary across individuals and over time, except for one (call it x) which changes across countries and over time (i.e. it takes the same value for all individuals in a particular country and in a particular period). My regression includes as well country and time fixed effects using the factor notation "i.year i.country".

    When I interact country and time to create a country-specific linear time trend (including the code "i.country##c.year" in place of "i.year i.country") Stata still gives me an estimate for the effect of x, which I assume it makes sense since x does not follow a linear trend over time. However, when I interact country and time allowing for non-linear country-specific time trends (using the code "i.country##i.year"), Stata still gives me an estimate for the effect of x.

    How is that possible? Shouldn't it drop x because of collinearity with the country-specific time dummies? Any help with this is much appreciated!

    Thanks,
    Eduard
    Last edited by Eduard Suari; 08 Oct 2019, 10:16.

  • #2
    Well, you don't show the actual commands and output, which makes it difficult to give you confident advice. But this kind of question arises with some regularity in this Forum, and I think the most common answer is this:

    Yes, your variable x should be colinear with the country##year effects. So something has to be dropped. But it doesn't have to be x. I suspect if you take a look at your results for the i.country##i.year effects, you will find that there is one more omitted than would be the case in the absence of the colinearity with x. The omission of one of those variables, instead of x, just as effectively identifies the model as omitting x would. Stata makes its own decisions about which variable(s) to omit in order to break colinearity. It really shouldn't matter to you which way Stata does it because the model's predictions will be exactly the same no matter which choice(s) Stata makes. But if for esthetic reasons you prefer to assure that this particular colinearity is dealt with by omitting x, then just leave it out of your regression command.

    The other common source of this problem is that the data are not really the way you think they are. Have you actually verified that x is constant within country#time in your data set? Perhaps you know it is supposed to be that way, but data sets commonly contain errors. You can verify it as follows:

    Code:
    by country time (x), sort: assert x[1] == x[_N]
    If x is actually constant within country#time, then you will get no output from this command. If it is not, you will get an error message.

    Comment


    • #3
      Thanks a lot! This was very useful. Indeed I found out that Stata was dropping out some of the time-country interactions when including my x variable.

      Comment

      Working...
      X