multiple regression residuals and "partialling out"

Hi All,

I would like to clarify a bit what "partialling out" means in multiple regression. Suppose I have three variables: Y, X, and Z.

First, I regress Y on Z and obtain the residuals from this regression. Then, I estimate the following:


Now, I estimate;


Conceptually, it seems to me like B1 should be identical in both regressions. However, this is not the case when I try it out myself. Can anybody clarify this a bit, or give me some reading? Thank you!