We will keep using the data shown in that example and can be found here: https://github.com/dstellotri/rmda
Before we were trying to under how to obtain beta from this model:
Now, we want to understand how changes once we add a covariate. In this case the full model will be:
Let’s go through several methods. Each of this inspire different ways of understanding what a covariate is really doing. What I recommend is going through this and trying to understand from your own perspective the intuition of what “controlling for a variable” is doing.
Regression
- First run the regression using the data and report what the value of is.
‣
Mean Comparison
- How would we obtain the value if we were to use averages?
‣
Using the formula
- Now obtain the value of beta 1 using the following Formula
‣
FWL Way
- Here is another method (similar to the one before) in which it shows how obtain the same beta and provides similar intuition. It’s called using the Frisch–Waugh–Lovell theorem.
reg batten parentsincome
Source | SS df MS Number of obs = 18
-------------+---------------------------------- F(1, 16) = 1.28
Model | .333333333 1 .333333333 Prob > F = 0.2746
Residual | 4.16666667 16 .260416667 R-squared = 0.0741
-------------+---------------------------------- Adj R-squared = 0.0162
Total | 4.5 17 .264705882 Root MSE = .51031
-------------------------------------------------------------------------------
batten | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------+----------------------------------------------------------------
parentsincome | .0066667 .0058926 1.13 0.275 -.005825 .0191583
_cons | 5.55e-17 .4580176 0.00 1.000 -.9709539 .9709539
-------------------------------------------------------------------------------
predict res_batten, res
reg income parentsincome
Source | SS df MS Number of obs = 18
-------------+---------------------------------- F(1, 16) = 167.82
Model | 14560.3333 1 14560.3333 Prob > F = 0.0000
Residual | 1388.16667 16 86.7604167 R-squared = 0.9130
-------------+---------------------------------- Adj R-squared = 0.9075
Total | 15948.5 17 938.147059 Root MSE = 9.3145
-------------------------------------------------------------------------------
income | Coef. Std. Err. t P>|t| [95% Conf. Interval]
--------------+----------------------------------------------------------------
parentsincome | 1.393333 .1075549 12.95 0.000 1.165327 1.62134
_cons | 65.33333 8.360044 7.81 0.000 47.61083 83.05583
-------------------------------------------------------------------------------
predict res_y, res
reg res_y res_batten
Source | SS df MS Number of obs = 18
-------------+---------------------------------- F(1, 16) = 31.20
Model | 917.606684 1 917.606684 Prob > F = 0.0000
Residual | 470.559999 16 29.4099999 R-squared = 0.6610
-------------+---------------------------------- Adj R-squared = 0.6398
Total | 1388.16668 17 81.6568637 Root MSE = 5.4231
------------------------------------------------------------------------------
res_y | Coef. Std. Err. t P>|t| [95% Conf. Interval]
-------------+----------------------------------------------------------------
res_batte | 14.84 2.656765 5.59 0.000 9.20791 20.47209
_cons | 8.28e-10 1.278237 0.00 1.000 -2.709741 2.709741
------------------------------------------------------------------------------
* This provides the beta of 14.84