Imagine predicting salary
of some professors from their years of experience (time
) controlling for/holding constant their number of publications (pubs
).
Question: Is the following regarding the meaning of holding constant their number of
pubs
correct, and demonstrable via simulation inR
?
Imagine we had countless professors, then take a sample of them with the exact same number of pubs
(e.g., $1$).
- Fit a regression model with only
time
as predictor, get the regression coef oftime
. - Take another sample with
pubs
of $2$, Fit the regression model again, get the regression coef oftime
. - Keep changing
pubs
to $3, 4,…$ and each time get the regression coef oftime
.
At the end, average of our regression coefs of time
will be a partial regression coefficient that has controlled for the pubs
of professors while predicting salary
from time
.
p.s. Is controlling for a predictor similar to integrating it out?