How to regress out unwanted vectors
Source: http://stats.stackexchange.com/questions/117840/how-to-regress-out-some-variables
Answer in the first place, one simple mathematics method.
It seems to me that the following is the mathematically simplest way to partial-out variables from a correlated set of items.
Consider a correlation matrix R for 5 items, where we want to "partial-out" the first two variables. This is the initial correlation-matrix: