<p>firms fixed effect - it is a firm specific dummy that will tell you what unique effect firm specific and time invariant unobservables are having on the regressand.</p>
<p>industry fixed effect - as above but this tell you the effect of industry specific and time invariant unobservables on the regressand.</p>
<p>firms fixed effects and industry * year fixed effect - this was already covered in the first part, but to recap it tells you the specific effect firm or industry in combination with specific year has on the regressand.</p>

CC BY-SA 4.0
2022-06-19T16:36:00.127Z
2022-06-19T16:36:00.127Z
Allyster Maxine G. Alvarez
<blockquote>
<p>What does industry * year fixed effect mean?</p>
</blockquote>
<p><span class="math-container">$Industry \cdot year$</span> fixed effect is just an interaction term between industry and dummy year variables. For example, you can have dummy particular industry, let us say finance where <span class="math-container">$D=1$</span> if firm is a finance firm and <span class="math-container">$0$</span> otherwise, then you can have a year dummy which will be set to equal <span class="math-container">$1$</span> for particular year and <span class="math-container">$0$</span> otherwise. Note typically you will have a dummies to cover industries in your sample and every year, I just used one industry and one year as an example.</p>
<p><span class="math-container">$Industry \cdot year$</span>  Is just multiplication of the two dummies, so you end up with third dummy that will be equal to <span class="math-container">$1$</span> only if data point is from both that particular industry and year. So it will tell you what &quot;special&quot; effect the industry and year had on the regressand.  The effect of this dummy will be amalgamation of effects of unobserved covariates on the regressand.</p>
<blockquote>
<p>What are the difference between (firms fixed effect and industry fixed effects) and ( firms fixed effects and industry * year fixed effect)?</p>
</blockquote>
<p><strong>firms fixed effect</strong> - it is a firm specific dummy that will tell you what unique effect firm specific and time invariant unobservables are having on the regressand.</p>
<p><strong>industry fixed effect</strong> - as above but this tell you the effect of <em>industry</em> specific and time invariant unobservables on the regressand.</p>
<p><strong>firms fixed effects and industry * year fixed effect</strong> - this was already covered in the first part, but to recap it tells you the specific effect firm or industry in combination with specific year has on the regressand.</p>
<blockquote>
<p>Are they all called two-way fixed effects in general?</p>
</blockquote>
<p>We talk about 2 way fixed effects when we use both spatial and temporal fixed effects. So when you use firm and year fixed effects you are talking about two way fixed effects. However, note when we talk about two way fixed effects there should actually be two sets of fixed effects not just some interaction like <span class="math-container">$industry \cdot time$</span> (see discussion in <a href="https://www.cambridge.org/core/journals/political-analysis/article/on-the-use-of-twoway-fixed-effects-regression-models-for-causal-inference-with-panel-data/F10006D0210407C5F9C7CAC1EEE3EF0D" rel="noreferrer">Imai &amp; Kim 2020</a>). But if you read the paper you linked in most regression tables they have separate firm fixed effects and year fixed effects. This being said the terminology might not always be used consistently in the applied work.</p>

CC BY-SA 4.0
2021-07-04T21:08:54.080Z
Thank 1muflon1. I am wondering this paert "*then you can have a year dummy which will be set to equal 1 for particular year and 0 otherwise*" Normally I use the real year, for example 1993, 1994, 1995 in year fixed effect. And I also have the industries called "Good", "Services", "Retail". So, can I do the same thing like your above, I mean interaction between real year and industry name as above? (of course the industry name will be transformed to numeric hy using code ```encode``` in STATA. Please let me know if my explanation is not clear
Phil Nguyen
CC BY-SA 4.0
2021-07-04T21:14:38.697Z
2> Regarding this part "**spatial and temporal fixed effects**" I understand that temporal is about time, but what is **spatial fixed effects** in this case then?
Phil Nguyen
CC BY-SA 4.0
2021-07-04T21:16:01.753Z
@BeautifulMindset, in stata the appropriate way how to use year fixed effects and industry fixed effects is to use `i.varname`. So for example, to add industry effects (assuming your variable is called industry) and year effects you would do `xtreg dep_var ind_var i.industry i.year, options`. For the interaction term, I don't remember how to do it in stata I only use stata to teach students at our university not for professional work, but my best guess would be just to have `i.industry*i.year`, try that if it does not work then just try to google it for stata
1muflon1
CC BY-SA 4.0
2021-07-04T21:18:12.547Z
@BeautifulMindset spatial means relating to space, so those are firm, individual etc fixed effects
1muflon1
CC BY-SA 4.0
2021-07-04T21:19:58.343Z
I think it is when we control for firm fixed effect and year fixed effect is like that ```reghdfe dep_var indep_var , a(TYPE2 yr)``` while '''TYPE2' is encoded firm to numeric and yr is the real year (1994,1995). And controlling for firm and industry*year fixed effect is like that ```reghdfe dep_var indep_var , a(TYPE2 INDC32#yr)```, while INDC32 is the encoded industry character to numeric. Is this correct then?
Phil Nguyen
CC BY-SA 4.0
2021-07-04T21:24:35.327Z
@BeautifulMindset I am not that familiar with reghdfe command, because again I dont use stata for professional work, I prefer python or R, but for most panel models year has to be declared with i.year if you are using it as a fixed effect because in that case you do not want to have it as a numeric variable, but maybe reghdfe does some conversion internally, if in the reghdfe manual it says thats how it should be done do it that way
1muflon1
CC BY-SA 4.0
2021-07-04T21:27:36.417Z
Thank you so much, 1muflon1, can I ask about the two-way fixed effect (TWFE), so, it seems that the "firm fixed effect and industry*year fixed effect" can not be called TWFE accurately 100% is what you mean?
Phil Nguyen
CC BY-SA 4.0
2021-07-04T21:29:46.027Z
And one more question, between two set "*firm fixed effectand year fixed effect*" and "*industry fixed effect and year fixed effect*". It seems that if we did the first set, we do not need to test the second set (because the first set is stricter than the second set already)?
Phil Nguyen
CC BY-SA 4.0
2021-07-04T21:29:58.630Z
@BeautifulMindset no, I dont think so. At least most of the time when people talk about two way fixed effects they just mean having a separate spatial and temporal fixed effect. However, as mentioned in my answer sometimes the terminology gets bit muddy, but just casually looking at the paper you linked I think when authors talk about 2way FE they just refer to the fact that virtually all of their model have *separate* firm and time fixed effects
1muflon1
CC BY-SA 4.0
2021-07-04T21:32:45.227Z
@BeautifulMindset I am not sure if I understand the second question, what do you mean stricter? you can have both individual effect for each firm, and effects that hold across whole industry. If you want to talk about about whether the anti-trust laws affect some specific industries, which is actually interesting thing to discuss you need to examine what the industry level effect is
1muflon1
CC BY-SA 4.0
2021-07-04T21:36:10.263Z
1muflon1: from my understanding, controlling for firm fixed effect also means that it also control for industry fixed effect already, so, if we already controlled for firm fixed effect, we do not need to control for industry fixed effect. It is because the change in industry also being reflected in the change in firms. Please let me know if my explanation still ambiguous.
Phil Nguyen
CC BY-SA 4.0
2021-07-04T21:42:37.237Z
@BeautifulMindset well there is a bit more nuance to it, but its true that if you include firm fixed effects you do not *have* to include industry fixed effects, but if you want to *quantify* the effect of an industry you need to include them, otherwise how else would you disentagle the effect of industry from the catch all firm fixed effect. Even within particular industry every firm will be unique
1muflon1
CC BY-SA 4.0
2021-07-04T21:43:48.357Z
an awesome answer which clears the cloud in my mind. Thanks a heap, 1muflon1!
Phil Nguyen
CC BY-SA 4.0
2021-07-09T06:01:39.660Z
Hi @1muflon1, regarding this "$Industry \cdot year$ ". So, whether $Industry \cdot year$  equalling to controlling for industry and year fixed effects at the same time?
Phil Nguyen
CC BY-SA 4.0
2021-07-09T07:05:41.573Z
@BeautifulMindset sorry, I misread your comment, no this is not the same as controlling for fixed year and industry effects at the same time, this is something extra, to see if there is some extra yearly effect that affects all industries in different way. For example recession occurring in year 2020 could on average have negative effect on all companies but some industries can benefit from recession
1muflon1
CC BY-SA 4.0
2021-08-05T04:22:53.757Z
Hi @1muflon1:Does "**The effect of this dummy will be an amalgamation of effects of unobserved covariates on the regressand**" mean that industry*year fixed effect partly solve the omitted variables problem?
Phil Nguyen
CC BY-SA 4.0
2021-08-05T20:48:00.313Z
Hi @1muflon1, can I say industry*year fixed effect be called as "comparing treated firms and their counterfactuals in the same year in the same industry" then? Thanks a lot
Phil Nguyen
CC BY-SA 4.0
2021-08-05T21:11:36.563Z
@NoviceMindset 1. Yes that’s the point of fixed effects, 2. No I would not say that counterfactuals are not observable
1muflon1
CC BY-SA 4.0
2021-07-03T21:02:36.410Z
2021-07-03T21:02:36.410Z
1muflon1
<p>In some papers, in column 4 Table 1, the author used firms fixed effects and industry*year fixed effect at the same time. I have two questions here:</p>
<ol>
<li><p>What does <em><strong>industry * year</strong></em> fixed effect mean?</p>
</li>
<li><p>What are the difference between (<strong>firms fixed effect and industry fixed effects</strong>) and ( <strong>firms fixed effects and <em>industry * year</em> fixed effect</strong>)? Are they all called <em><strong>two-way fixed effects</strong></em> in general?</p>
</li>
</ol>

CC BY-SA 4.0
2024-02-08T17:45:08.327Z
One way to think about [industry * year] fixed effects is that it allows for industry-specific time trends. Compared to [industry+year] where you assume all industries have the same time trend. So for example, if you are doing wage regressions - where the wage is the independent variable - and you believe that the efficiency of firms and therefore the wages of the employees develop differently over time across industries, then it is a good idea to use [industry * year] fixed effects rather than [industry+year] fixed effects.
Jesper Hybel
CC BY-SA 4.0
2024-02-08T17:45:19.323Z
But of course, you know that already [link](https://economics.stackexchange.com/questions/43952/why-we-need-to-control-for-the-interation-of-year-and-industry-fixed-effects/43954#43954)
Jesper Hybel
<econometrics><fixed-effects><causality>
What are the difference between industry fixed effects and industry*year fixed effects?
Phil Nguyen
# What are the difference between industry fixed effects and industry*year fixed effects?

(Asked by: username_0 on 2021-07-02)

In some papers, in column 4 Table 1, the author used firms fixed effects and industry\*year fixed effect at the same time. I have two questions here:

1. What does ***industry \* year*** fixed effect mean?
2. What are the difference between (**firms fixed effect and industry fixed effects**) and ( **firms fixed effects and *industry \* year* fixed effect**)? Are they all called ***two-way fixed effects*** in general?

**Tags:** econometrics, fixed-effects, causality

> **Comments:**
> **username_1**: One way to think about [industry * year] fixed effects is that it allows for industry-specific time trends. Compared to [industry+year] where you assume all industries have the same time trend. So for example, if you are doing wage regressions - where the wage is the independent variable - and you believe that the efficiency of firms and therefore the wages of the employees develop differently over time across industries, then it is a good idea to use [industry * year] fixed effects rather than [industry+year] fixed effects.  
> **username_1**: But of course, you know that already [link](https://economics.stackexchange.com/questions/43952/why-we-need-to-control-for-the-interation-of-year-and-industry-fixed-effects/43954#43954)  

---

## 2 answers

### Answer by username_3 on 2021-07-03. Score: 3 | Accepted answer

> What does industry \* year fixed effect mean?

$Industry \cdot year$ fixed effect is just an interaction term between industry and dummy year variables. For example, you can have dummy particular industry, let us say finance where $D=1$ if firm is a finance firm and $0$ otherwise, then you can have a year dummy which will be set to equal $1$ for particular year and $0$ otherwise. Note typically you will have a dummies to cover industries in your sample and every year, I just used one industry and one year as an example.

$Industry \cdot year$ Is just multiplication of the two dummies, so you end up with third dummy that will be equal to $1$ only if data point is from both that particular industry and year. So it will tell you what "special" effect the industry and year had on the regressand. The effect of this dummy will be amalgamation of effects of unobserved covariates on the regressand.

> What are the difference between (firms fixed effect and industry fixed effects) and ( firms fixed effects and industry \* year fixed effect)?

**firms fixed effect** - it is a firm specific dummy that will tell you what unique effect firm specific and time invariant unobservables are having on the regressand.

**industry fixed effect** - as above but this tell you the effect of *industry* specific and time invariant unobservables on the regressand.

**firms fixed effects and industry \* year fixed effect** - this was already covered in the first part, but to recap it tells you the specific effect firm or industry in combination with specific year has on the regressand.

> Are they all called two-way fixed effects in general?

We talk about 2 way fixed effects when we use both spatial and temporal fixed effects. So when you use firm and year fixed effects you are talking about two way fixed effects. However, note when we talk about two way fixed effects there should actually be two sets of fixed effects not just some interaction like $industry \cdot time$ (see discussion in [Imai & Kim 2020](https://www.cambridge.org/core/journals/political-analysis/article/on-the-use-of-twoway-fixed-effects-regression-models-for-causal-inference-with-panel-data/F10006D0210407C5F9C7CAC1EEE3EF0D)). But if you read the paper you linked in most regression tables they have separate firm fixed effects and year fixed effects. This being said the terminology might not always be used consistently in the applied work.

> **Comments:**
> **username_0**: Thank username_3. I am wondering this paert "*then you can have a year dummy which will be set to equal 1 for particular year and 0 otherwise*" Normally I use the real year, for example 1993, 1994, 1995 in year fixed effect. And I also have the industries called "Good", "Services", "Retail". So, can I do the same thing like your above, I mean interaction between real year and industry name as above? (of course the industry name will be transformed to numeric hy using code ```encode``` in STATA. Please let me know if my explanation is not clear  
> **username_0**: 2> Regarding this part "**spatial and temporal fixed effects**" I understand that temporal is about time, but what is **spatial fixed effects** in this case then?  
> **username_3**: @BeautifulMindset, in stata the appropriate way how to use year fixed effects and industry fixed effects is to use `i.varname`. So for example, to add industry effects (assuming your variable is called industry) and year effects you would do `xtreg dep_var ind_var i.industry i.year, options`. For the interaction term, I don't remember how to do it in stata I only use stata to teach students at our university not for professional work, but my best guess would be just to have `i.industry*i.year`, try that if it does not work then just try to google it for stata  
> **username_3**: @BeautifulMindset spatial means relating to space, so those are firm, individual etc fixed effects  
> **username_0**: I think it is when we control for firm fixed effect and year fixed effect is like that ```reghdfe dep_var indep_var , a(TYPE2 yr)``` while '''TYPE2' is encoded firm to numeric and yr is the real year (1994,1995). And controlling for firm and industry*year fixed effect is like that ```reghdfe dep_var indep_var , a(TYPE2 INDC32#yr)```, while INDC32 is the encoded industry character to numeric. Is this correct then?  
> **username_3**: @BeautifulMindset I am not that familiar with reghdfe command, because again I dont use stata for professional work, I prefer python or R, but for most panel models year has to be declared with i.year if you are using it as a fixed effect because in that case you do not want to have it as a numeric variable, but maybe reghdfe does some conversion internally, if in the reghdfe manual it says thats how it should be done do it that way  
> **username_0**: Thank you so much, username_3, can I ask about the two-way fixed effect (TWFE), so, it seems that the "firm fixed effect and industry*year fixed effect" can not be called TWFE accurately 100% is what you mean?  
> **username_0**: And one more question, between two set "*firm fixed effectand year fixed effect*" and "*industry fixed effect and year fixed effect*". It seems that if we did the first set, we do not need to test the second set (because the first set is stricter than the second set already)?  
> **username_3**: @BeautifulMindset no, I dont think so. At least most of the time when people talk about two way fixed effects they just mean having a separate spatial and temporal fixed effect. However, as mentioned in my answer sometimes the terminology gets bit muddy, but just casually looking at the paper you linked I think when authors talk about 2way FE they just refer to the fact that virtually all of their model have *separate* firm and time fixed effects  
> **username_3**: @BeautifulMindset I am not sure if I understand the second question, what do you mean stricter? you can have both individual effect for each firm, and effects that hold across whole industry. If you want to talk about about whether the anti-trust laws affect some specific industries, which is actually interesting thing to discuss you need to examine what the industry level effect is  
> **username_0**: username_3: from my understanding, controlling for firm fixed effect also means that it also control for industry fixed effect already, so, if we already controlled for firm fixed effect, we do not need to control for industry fixed effect. It is because the change in industry also being reflected in the change in firms. Please let me know if my explanation still ambiguous.  
> **username_3**: @BeautifulMindset well there is a bit more nuance to it, but its true that if you include firm fixed effects you do not *have* to include industry fixed effects, but if you want to *quantify* the effect of an industry you need to include them, otherwise how else would you disentagle the effect of industry from the catch all firm fixed effect. Even within particular industry every firm will be unique  
> **username_0**: an awesome answer which clears the cloud in my mind. Thanks a heap, username_3!  
> **username_0**: Hi @username_3, regarding this "$Industry \cdot year$ ". So, whether $Industry \cdot year$  equalling to controlling for industry and year fixed effects at the same time?  
> **username_3**: @BeautifulMindset sorry, I misread your comment, no this is not the same as controlling for fixed year and industry effects at the same time, this is something extra, to see if there is some extra yearly effect that affects all industries in different way. For example recession occurring in year 2020 could on average have negative effect on all companies but some industries can benefit from recession  
> **username_0**: Hi @username_3:Does "**The effect of this dummy will be an amalgamation of effects of unobserved covariates on the regressand**" mean that industry*year fixed effect partly solve the omitted variables problem?  
> **username_0**: Hi @username_3, can I say industry*year fixed effect be called as "comparing treated firms and their counterfactuals in the same year in the same industry" then? Thanks a lot  
> **username_3**: @NoviceMindset 1. Yes that’s the point of fixed effects, 2. No I would not say that counterfactuals are not observable  

---

### Answer by username_2 on 2022-06-19. Score: 0

firms fixed effect - it is a firm specific dummy that will tell you what unique effect firm specific and time invariant unobservables are having on the regressand.

industry fixed effect - as above but this tell you the effect of industry specific and time invariant unobservables on the regressand.

firms fixed effects and industry \* year fixed effect - this was already covered in the first part, but to recap it tells you the specific effect firm or industry in combination with specific year has on the regressand.


---

