<p>From <a href="https://en.wikipedia.org/wiki/Dummy_variable_(statistics)#Incorporating_a_dummy_independent" rel="nofollow noreferrer">Wikipedia</a> (emphasis of the simple example by me):</p>
<blockquote>
<p>In the panel data, fixed effects estimator dummies are created for each of the units in cross-sectional data (e.g. firms or countries) or periods in a pooled time-series. However, in such regressions either the constant term has to be removed or one of the dummies has to be removed, with its associated category becoming the base category against which the others are assessed in order to avoid the dummy variable trap:
<br>The constant term in all regression equations is a coefficient multiplied by a regressor equal to one. When the regression is expressed as a matrix equation, the matrix of regressors then consists of a column of ones (the constant term), vectors of zeros and ones (the dummies), and possibly other regressors. <strong>If one includes both male and female dummies, say, the sum of these vectors is a vector of ones, since every observation is categorized as either male or female. This sum is thus equal to the constant term's regressor, the first vector of ones. As result, the regression equation will be unsolvable,</strong> even by the typical pseudoinverse method. In other words: if both the vector-of-ones (constant term) regressor and an exhaustive set of dummies are present, perfect multicollinearity occurs, and the system of equations formed by the regression does not have a unique solution. This is referred to as the dummy variable trap. The trap can be avoided by removing either the constant term or one of the offending dummies. The removed dummy then becomes the base category against which the other categories are compared.</p>
</blockquote>
<p>In the output above every year has its own dummy variable. To avoid the trap one had to be removed. The dummy for the second year, 1993 was removed from the regression equation.</p>

CC BY-SA 4.0
2021-06-09T06:09:43.057Z
2021-06-09T06:09:43.057Z
Giskard
<p>I saw an <a href="https://economics.stackexchange.com/questions/45378/why-excluding-intercept-is-dangerous-if-there-is-no-literature-back-up-in-did-se">interesting Economics post</a> yesterday with the long comment. I post the regression result of the OP here</p>
<p><a href="https://i.sstatic.net/nR2mq.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/nR2mq.png" alt="enter image description here" /></a></p>
<p>I saw @chan1142 stated that</p>
<blockquote>
<p>Thanks. I see the _cons row. That's the intercept; the dummy variable for the reference group (probably TYPE2 = 1) is omitted in order to avoid the <strong>dummy variable trap</strong></p>
</blockquote>
<p>Can you simply exlain the <strong>dummy variable trap</strong> in this case for me? And why the reference group here is TYPE2, whether TYPE2 is a binary variable?</p>

<econometrics>
What is the "dummy variable trap"?
Phil Nguyen
# What is the "dummy variable trap"?

(Asked by: username_0 on 2021-06-09)

I saw an [interesting Economics post](https://economics.stackexchange.com/questions/45378/why-excluding-intercept-is-dangerous-if-there-is-no-literature-back-up-in-did-se) yesterday with the long comment. I post the regression result of the OP here

[![enter image description here](https://i.sstatic.net/nR2mq.png)](https://i.sstatic.net/nR2mq.png)

I saw @chan1142 stated that

> Thanks. I see the \_cons row. That's the intercept; the dummy variable for the reference group (probably TYPE2 = 1) is omitted in order to avoid the **dummy variable trap**

Can you simply exlain the **dummy variable trap** in this case for me? And why the reference group here is TYPE2, whether TYPE2 is a binary variable?

**Tags:** econometrics

---

## 1 answers

### Answer by username_1 on 2021-06-09. Score: 1

From [Wikipedia](https://en.wikipedia.org/wiki/Dummy_variable_(statistics)#Incorporating_a_dummy_independent) (emphasis of the simple example by me):

> In the panel data, fixed effects estimator dummies are created for each of the units in cross-sectional data (e.g. firms or countries) or periods in a pooled time-series. However, in such regressions either the constant term has to be removed or one of the dummies has to be removed, with its associated category becoming the base category against which the others are assessed in order to avoid the dummy variable trap:
>   
> The constant term in all regression equations is a coefficient multiplied by a regressor equal to one. When the regression is expressed as a matrix equation, the matrix of regressors then consists of a column of ones (the constant term), vectors of zeros and ones (the dummies), and possibly other regressors. **If one includes both male and female dummies, say, the sum of these vectors is a vector of ones, since every observation is categorized as either male or female. This sum is thus equal to the constant term's regressor, the first vector of ones. As result, the regression equation will be unsolvable,** even by the typical pseudoinverse method. In other words: if both the vector-of-ones (constant term) regressor and an exhaustive set of dummies are present, perfect multicollinearity occurs, and the system of equations formed by the regression does not have a unique solution. This is referred to as the dummy variable trap. The trap can be avoided by removing either the constant term or one of the offending dummies. The removed dummy then becomes the base category against which the other categories are compared.

In the output above every year has its own dummy variable. To avoid the trap one had to be removed. The dummy for the second year, 1993 was removed from the regression equation.


---

