<h2>Summarised explanation:</h2>
<p>Controlling for a variable essentially means you're measuring an independent variable and accounting for its presence to negate/remove its flow-on effects on other variables and the dependent variable (e.g. interaction effects, omitted variable bias, (multi-)colinearity etc.)</p>
<p>So when we control for zipcodes, we are taking actions in our statistical analysis (regression) to ensure that we factor in the direct and indirect effects of zipcodes in our statistical model to make it efficient and not result in incorrect readings due to statistical bias. To achieve this, we can use techniques such as but not limited to: multi-linear regression, interaction variables.</p>
<h2>Detailed explanation:</h2>
<p>If your goal is to analyse the pure effect of having a pool installed at a property on its price, &quot;controlling for&quot; zipcodes would be to make sure that the impact of zipcodes (e.g. living in a rich or poor socio-economic area) doesn't influence the reading (co-efficient) for the variable we're looking to see the pure effect of (in this case, pools increasing house prices).</p>
<p>So in the case where you do a single variable analysis (a mono-linear/simple regression): <code>[how does &lt;hasPool&gt; impact &lt;housePrice&gt;]</code>, the variable hasPool will have an inaccurate statistical significance and also an overstated effect value (the variable <code>hasPool</code> will incorporate other things such as the fact that &quot;rich zipcodes have pools, rich zipcodes also increase house prices&quot;). This situation is omitted variable bias (you've forgotten to factor in zipcodes and part of their effect is being read as being as a result of having a pool).</p>
<blockquote>
<p>NB: This doesn't mean simple regressions are bad or useless. They're very helpful to quickly triage if a variable is worth considering into a model before committing to factoring it into the model. This is because it's quicker to to get a quick (but of course as noted above, very inprecise) look at the variable rather than immediately imputting into the model you are using which (if it has loads of data and many variables) could take ages to finish processing. However, you shouldn't be using a simple regression to find out the pure effect of an independent variable on its own - instead a multi-linear regression is more effective.</p>
</blockquote>
<p>You could then do a multi-linear regression (analysis incorporating more than one variable) such as: <code>[how do &lt;hasPool&gt; and &lt;locatedInRichZipcode&gt; impact &lt;housePrice&gt;]</code>.
The variables <code>hasPool</code> and <code>locatedInRichZipcode</code> are now both being factored into what causes increases in house price. hasPool is now more accurate, as the fact that the effect of being located in a rich zipcode is also being measured. However the co-linearity (high correlation between two variables) between having a pool and being in a rich zipcode increases the standard errors of the co-effecients, and thus could result in the variable being incorrectly found to be statistically insignificant, and also makes the pure effect of the variables measured blurred.</p>
<p>However, being in a rich zipcode and having a pool are closely related occurances, so we'd need to also incorporate an interaction variable <code>hasPoolAndLocatedInRichZipcode</code> to account for the venn-diagram &quot;shared-zone&quot; effect of having both a pool and being in a rich area: <code>[how do &lt;hasPool&gt;, &lt;locatedInRichZipCode&gt;, and &lt;hasPoolAndLocatedInRichZipcode&gt; impact &lt;housePrice&gt;]</code>.</p>
<p>This is a more effective regression and though the statistical analysis improvements in &quot;controlling&quot; (i.e. taking into account) zipcodes and their effect, we are better able to approximate what the pure effect (co-efficient) of a variable such as having a pool is on house prices.</p>
<h2>Please note!</h2>
<p>Of course, the above examples are an extreme simplification of what variables should be included and how some of the techniques work to make the explanation more straightforward to read. Other regression techniques could be used and obviously variables such say how many rooms, the sqft size of a house should be factored, the size of pool (a large olympic pool may make the house very valuable, whereas a teeny hot tub sized pool may suck and may burden the house's value) in order to gain a more accurate regression and ever more accurate reading of what the pure effect (co-efficient) of the variable hasPool is.</p>
<blockquote>
<p>Why do I say &quot;ever more accurate&quot;? - Well, that's because there's basically an infinite amount of variables that could impact a house price, and thus we can never find out what the EXACT pure effect of the variable hasPool is. In a perfect world, we could hypothetically run a regression with the nigh-infinite amount of variables, but due to limitations such as research budget, availability of data, complexity of the regression model that the computer needs to analyse (increasing processing time) etc., it's best that we try to compact the amount of variables observed in the regression to make an efficient but never perfect regression to analyse the effect.</p>
</blockquote>
<p>Hope this helps!
If you want to learn in more explicit detail about controlling for variables or just stats/econometrics in general, I absolutely recommend reading <a href="https://statisticsbyjim.com/" rel="nofollow noreferrer">Statistics By Jim</a>!</p>

CC BY-SA 4.0
2022-04-24T15:35:24.100Z
2022-04-24T15:35:24.100Z
Treppich
<p>Let's say I want to see the effect of having a pool on the price of properties in a city. What does it really mean <strong>to control</strong> for zipcodes?</p>
<p>And does this answer the crucial question that I want to include the effect of zipcodes into my analysis?</p>

CC BY-SA 4.0
2022-04-23T04:17:54.560Z
In econometrics "to control" means "to account for". But I think a more elaborated answer exists.
manifold
<microeconomics><econometrics><applied-econometrics>
What does it mean to control for a variable?
C. Master
# What does it mean to control for a variable?

(Asked by: username_0 on 2022-04-22)

Let's say I want to see the effect of having a pool on the price of properties in a city. What does it really mean **to control** for zipcodes?

And does this answer the crucial question that I want to include the effect of zipcodes into my analysis?

**Tags:** microeconomics, econometrics, applied-econometrics
> **Comments:**
> **username_1**: In econometrics "to control" means "to account for". But I think a more elaborated answer exists.  

---

## 1 answers

### Answer by username_2 on 2022-04-24. Score: 1

## Summarised explanation:

Controlling for a variable essentially means you're measuring an independent variable and accounting for its presence to negate/remove its flow-on effects on other variables and the dependent variable (e.g. interaction effects, omitted variable bias, (multi-)colinearity etc.)

So when we control for zipcodes, we are taking actions in our statistical analysis (regression) to ensure that we factor in the direct and indirect effects of zipcodes in our statistical model to make it efficient and not result in incorrect readings due to statistical bias. To achieve this, we can use techniques such as but not limited to: multi-linear regression, interaction variables.

## Detailed explanation:

If your goal is to analyse the pure effect of having a pool installed at a property on its price, "controlling for" zipcodes would be to make sure that the impact of zipcodes (e.g. living in a rich or poor socio-economic area) doesn't influence the reading (co-efficient) for the variable we're looking to see the pure effect of (in this case, pools increasing house prices).

So in the case where you do a single variable analysis (a mono-linear/simple regression): `[how does  impact ]`, the variable hasPool will have an inaccurate statistical significance and also an overstated effect value (the variable `hasPool` will incorporate other things such as the fact that "rich zipcodes have pools, rich zipcodes also increase house prices"). This situation is omitted variable bias (you've forgotten to factor in zipcodes and part of their effect is being read as being as a result of having a pool).

> NB: This doesn't mean simple regressions are bad or useless. They're very helpful to quickly triage if a variable is worth considering into a model before committing to factoring it into the model. This is because it's quicker to to get a quick (but of course as noted above, very inprecise) look at the variable rather than immediately imputting into the model you are using which (if it has loads of data and many variables) could take ages to finish processing. However, you shouldn't be using a simple regression to find out the pure effect of an independent variable on its own - instead a multi-linear regression is more effective.

You could then do a multi-linear regression (analysis incorporating more than one variable) such as: `[how do  and  impact ]`.
The variables `hasPool` and `locatedInRichZipcode` are now both being factored into what causes increases in house price. hasPool is now more accurate, as the fact that the effect of being located in a rich zipcode is also being measured. However the co-linearity (high correlation between two variables) between having a pool and being in a rich zipcode increases the standard errors of the co-effecients, and thus could result in the variable being incorrectly found to be statistically insignificant, and also makes the pure effect of the variables measured blurred.

However, being in a rich zipcode and having a pool are closely related occurances, so we'd need to also incorporate an interaction variable `hasPoolAndLocatedInRichZipcode` to account for the venn-diagram "shared-zone" effect of having both a pool and being in a rich area: `[how do , , and  impact ]`.

This is a more effective regression and though the statistical analysis improvements in "controlling" (i.e. taking into account) zipcodes and their effect, we are better able to approximate what the pure effect (co-efficient) of a variable such as having a pool is on house prices.

## Please note!

Of course, the above examples are an extreme simplification of what variables should be included and how some of the techniques work to make the explanation more straightforward to read. Other regression techniques could be used and obviously variables such say how many rooms, the sqft size of a house should be factored, the size of pool (a large olympic pool may make the house very valuable, whereas a teeny hot tub sized pool may suck and may burden the house's value) in order to gain a more accurate regression and ever more accurate reading of what the pure effect (co-efficient) of the variable hasPool is.

> Why do I say "ever more accurate"? - Well, that's because there's basically an infinite amount of variables that could impact a house price, and thus we can never find out what the EXACT pure effect of the variable hasPool is. In a perfect world, we could hypothetically run a regression with the nigh-infinite amount of variables, but due to limitations such as research budget, availability of data, complexity of the regression model that the computer needs to analyse (increasing processing time) etc., it's best that we try to compact the amount of variables observed in the regression to make an efficient but never perfect regression to analyse the effect.

Hope this helps!
If you want to learn in more explicit detail about controlling for variables or just stats/econometrics in general, I absolutely recommend reading [Statistics By Jim](https://statisticsbyjim.com/)!


---

