Code
| (1) | (2) | |
|---|---|---|
| (Intercept) | −556.823*** | −299.119*** |
| (21.654) | (28.069) | |
| Income | 0.022*** | 0.019*** |
| (0.000) | (0.000) | |
| Kidhome | −230.610*** | |
| (16.945) | ||
| Num.Obs. | 2000 | 2000 |
| R2 | 0.629 | 0.661 |
| + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001 |
Please run the two regressions on your Quarto document and export the regression table:
Regression 1: \(Spending\) ~ \(Income\)
Regression 2: \(Spending\) ~ \(Income\) + \(Kidhome\)
| (1) | (2) | |
|---|---|---|
| (Intercept) | −556.823*** | −299.119*** |
| (21.654) | (28.069) | |
| Income | 0.022*** | 0.019*** |
| (0.000) | (0.000) | |
| Kidhome | −230.610*** | |
| (16.945) | ||
| Num.Obs. | 2000 | 2000 |
| R2 | 0.629 | 0.661 |
| + p < 0.1, * p < 0.05, ** p < 0.01, *** p < 0.001 |
Using our common sense, let’s think about how income can causally affect total spending:
To obtain causal effects from non-experimental data, we refer to obtaining the direct effects of a focal \(X\) variable on the outcome variable \(Y\).
However, if we do not include Kidhome in the regression, the regression coefficient 0.022 measures the total effects of income, including
direct effects of income on total spending, 0.019
indirect effects of income on other intermediate variables, which in turn affect income. These intermediate variables are called confounding variables or confounders.
Therefore, it is important to include all other confounding variables, which affect income and total spending at the same time, to control for the indirect effects via other variables, in order to tease out the clean direct effect of income on total spending.
“Some variables are bad controls and should not be included in a regression model, even when their inclusion might be expected to change the short regression coefficients. Bad controls are variables that are themselves outcome variables in the notional experiment at hand. That is, bad controls might just as well be dependent variables too. Good controls are variables that we can think of having been fixed at the time the regressor of interest was determined.”
Sometimes, control variables may be statistically insignificant, they should NOT be removed from the regression because they still serve the purpose of control variables.
A high correlation between independent variables is generally not an issue in practice. However, if some variables are mechanically correlated, then we should not put them altogether in the regression to avoid perfect collinearity problems.
For correct statistical inference, we should construct the correct standard errors
vcov = "hetero" in feols().cluster = ~ ID in feols().Question: what is the best you can do with data_full to estimate the causal effect of income on spending?
Now that we have included Kidhome to tease out the effect of kids, what problems do we still have that prevent us from getting causal effect of income on total spending?
Due to data availability, we are never able to include all confounding variables in the regression. Therefore, strictly speaking, we can never obtain causal effects from non-experimental data by merely controlling confounding variables in a linear regression.
Mathematically speaking, because we can never control all confounding factors, the error term is always correlated with income to some extent, violating the exogeneity assumption of a linear regression model \(E[\epsilon|X] = 0\).
total_spending for each individual in each Income group.Income on total_spending.\[ Spending = \beta_0 + \beta_1Income + \epsilon \]
No, there are no confounders remaining, because Income is randomised, so Income should be uncorrelated with anything. Thus no confounders remain.
Endogeneity refers to an econometric issue with OLS linear regression, in which a focal explanatory variable is correlated with the error term, such that the Conditional Independence Assumption (CIA) for OLS linear regression, \(E[\epsilon|X] = 0\), is violated.
An omitted variable is a determinant of the outcome variable \(y_i\) that is correlated with the focal explanatory variable \(x_i\), but is not included in the regression, either due to data unavailability or ignorance of data scientists.
Two conditions for omitted variable bias
The omitted variable affects the dependent variable.
The omitted variable is correlated with the focal explanatory variable.3
Education on a person’s salary.\[ Salary_t = \beta_0 + \beta_1 Education_t + \epsilon_t \]
The issue here is that
Educationis correlated with other unobserved factors, such asIQ,personality,family background, etc. These unobserved factors may also affectsalary. Therefore, the error term \(\epsilon\) is correlated withEducation, violating the exogeneity assumption of OLS regression.
\[ Sales_t = \beta_0 + \beta_1 Price_t + \epsilon_t \]
The issue here is that the price is correlated with other unobserved factors, such as
brand image,product quality,advertising, etc. These unobserved factors may also affectsales. Therefore, the error term \(\epsilon\) is correlated withPrice, violating the exogeneity assumption of OLS regression.
Reverse causality refers to the phenomenon that the independent variable \(X_i\) affects the dependent variable \(y_i\) and the dependent variable \(y_i\) also affects the independent variable \(X_i\) at the same time.
\[ Sales_t = \beta_0 + \beta_1 Price_t + \epsilon_t \]
\[ NumOrders_t = \beta_0 + \beta_1 NumRestaurants_t + \epsilon_t \]
We need to run A/B testings and randomise how many restaurants a customer can see on their apps.
This question is not just limited to UberEat; it is in fact related to any platform business with network effect!
Suppose that a perfect measure of an independent variable is impossible. That is, instead of observing \(x^{real}\), what is actually observed is \(x^{observed} = x^{real} + \nu\) where \(\nu\) is the measurement error with random “noise”. In this case, a model given by \[ y_i=\alpha+\beta x^{observed}_i+\varepsilon_i \]
would not give us the coefficients from the regression we actually want to run \[ y_i=\alpha+\beta x^{real}_i+\varepsilon_i \]
This endogeneity issue is called measurement error.
grades as a proxy for AbilityESGRating as a proxy for firms’ ESGPerformanceaudit fee as a proxy for audit qualityIn economics, MPC refers to the proportion of an additional unit of income that is spent on consumption.↩︎
Angrist, Joshua D., and Jörn-Steffen Pischke. Mostly harmless econometrics: An empiricist’s companion. Princeton university press, 2009.↩︎
If the omitted variable is uncorrelated with X, then we do not have OVB problem, but the error term will have a larger noise and coefficients will have larger standard errors. Therefore, it’s better to control these variables if possible.↩︎