<p>This seems like a question about perfect collinearity.
Does <span class="math-container">$i1 +i2+i3 = 1$</span> always? If so, then you must exclude one of them if you want to include a constant. This would be the case if all the homes are either in the north, south, or center. If you have some homes in another region (east or west), then you can include all three of your variables as well as a constant because it is not always the case that <span class="math-container">$i1 +i2 +i3 = 1$</span>.</p>
<p>It's analogous for the second set of 3 indicator variables.</p>
<p>Suppose <span class="math-container">$i1+i2+i3 = 1$</span>, that is, all homes are either in north, south, or center. Then, if you include <span class="math-container">$i1$</span> and <span class="math-container">$i2$</span> as well as a constant, the constant is interpreted as &quot;the average price for the omitted group (south)&quot; while the coefficient for <span class="math-container">$i1$</span> is &quot;the average difference in price for homes in the north compared to the south&quot;.</p>
<p>You could instead include <span class="math-container">$i1$</span>, <span class="math-container">$i2$</span>, and <span class="math-container">$i3$</span> but exclude the constant, in which case coefficients directly estimate the average for each group.</p>
<p>If you include other covariates (such as dummy variables for color of the walls), the above interpretation only changes in that we must add &quot;holding fixed all other covariates&quot;.</p>

CC BY-SA 4.0
2022-09-15T17:17:27.323Z
2022-09-15T17:17:27.323Z
Michael Gmeiner
<p>My dataset contains two numerical variables (<code>n1</code>, <code>n2</code>) and six indicator variables. The first three indicator variables specify the location of a property (<code>i1</code>=north, <code>i2</code>=center, <code>i3</code>=south), the next three indicator variables specify the color of walls (<code>j1</code>=blue, <code>j2</code>=red, <code>j3</code>=other). Let's say I want to predict the property price (<code>y</code>). I want to run an ordinary least squares regression. I have two questions:</p>
<ol>
<li>Should I include all indicator variables or should I exclude one per group? And why?</li>
</ol>
<p><code>y = b1 * n1 + b2 * n2 + b3 * i1 + b4 * i2 + b5 * i3 + b6 * j1 + b7 * j2 + b8 * j3</code></p>
<p>vs</p>
<p><code>y = b1 * n1 + b2 * n2 + b3 * i1 + b4 * i2 + b6 * j1 + b7 * j2</code></p>
<ol start="2">
<li>Should I include an intercept? And how does it affect the interpretation of the indicator variables?</li>
</ol>
<p><code>y = b0 + b1 * n1 + b2 * n2 + b3 * i1 + b4 * i2 + b5 * i3 + b6 * j1 + b7 * j2 + b8 * j3</code></p>
<p>and</p>
<p><code>y = b0 + b1 * n1 + b2 * n2 + b3 * i1 + b4 * i2 + b6 * j1 + b7 * j2</code></p>

CC BY-SA 4.0
2022-09-15T09:33:36.547Z
Why do you suspect there might be a case for excluding some variables? What do your regressions tell you?
BrsG
CC BY-SA 4.0
2022-09-15T10:05:39.303Z
Otherwise you overfit the model. The meaning of the regressors is already in the question
NC520
CC BY-SA 4.0
2022-09-15T10:18:04.273Z
I don't understand whether I should exclude one indicator variable from each group or just one overall.
NC520
CC BY-SA 4.0
2022-09-15T10:36:24.663Z
This is a common and well-answered question in stats.stackexchange.com.
Alalalalaki
<econometrics><applied-econometrics><statistics>
OLS with multiple indicator variables
NC520
# OLS with multiple indicator variables

(Asked by: username_0 on 2022-09-15)

My dataset contains two numerical variables (`n1`, `n2`) and six indicator variables. The first three indicator variables specify the location of a property (`i1`=north, `i2`=center, `i3`=south), the next three indicator variables specify the color of walls (`j1`=blue, `j2`=red, `j3`=other). Let's say I want to predict the property price (`y`). I want to run an ordinary least squares regression. I have two questions:

1. Should I include all indicator variables or should I exclude one per group? And why?

`y = b1 * n1 + b2 * n2 + b3 * i1 + b4 * i2 + b5 * i3 + b6 * j1 + b7 * j2 + b8 * j3`

vs

`y = b1 * n1 + b2 * n2 + b3 * i1 + b4 * i2 + b6 * j1 + b7 * j2`

2. Should I include an intercept? And how does it affect the interpretation of the indicator variables?

`y = b0 + b1 * n1 + b2 * n2 + b3 * i1 + b4 * i2 + b5 * i3 + b6 * j1 + b7 * j2 + b8 * j3`

and

`y = b0 + b1 * n1 + b2 * n2 + b3 * i1 + b4 * i2 + b6 * j1 + b7 * j2`

**Tags:** econometrics, applied-econometrics, statistics

> **Comments:**
> **username_1**: Why do you suspect there might be a case for excluding some variables? What do your regressions tell you?  
> **username_0**: Otherwise you overfit the model. The meaning of the regressors is already in the question  
> **username_0**: I don't understand whether I should exclude one indicator variable from each group or just one overall.  
> **username_2**: This is a common and well-answered question in stats.stackexchange.com.  

---

## 1 answers

### Answer by username_3 on 2022-09-15. Score: 1 | Accepted answer

This seems like a question about perfect collinearity.
Does $i1 +i2+i3 = 1$ always? If so, then you must exclude one of them if you want to include a constant. This would be the case if all the homes are either in the north, south, or center. If you have some homes in another region (east or west), then you can include all three of your variables as well as a constant because it is not always the case that $i1 +i2 +i3 = 1$.

It's analogous for the second set of 3 indicator variables.

Suppose $i1+i2+i3 = 1$, that is, all homes are either in north, south, or center. Then, if you include $i1$ and $i2$ as well as a constant, the constant is interpreted as "the average price for the omitted group (south)" while the coefficient for $i1$ is "the average difference in price for homes in the north compared to the south".

You could instead include $i1$, $i2$, and $i3$ but exclude the constant, in which case coefficients directly estimate the average for each group.

If you include other covariates (such as dummy variables for color of the walls), the above interpretation only changes in that we must add "holding fixed all other covariates".


---

