successively regresses each variable x our of the rest of the x matrix and y, then calls itself again. Returns a vector of residuals for each variable.

regress_step(x, y)

Arguments

x

a design matrix. Function called recursively with fewer columns of x until finished

y

a response vector

Value

a matrix of residuals, each column corresponds to a column of x