[SciPy-User] obtaining residuals from linear regression?

Jeremy Gray jrgray@gmail....
Fri Aug 26 11:06:19 CDT 2011


I'm new to scipy, and hope the answer is not trivial. I've searched the
archives, googled, and looked at documentation for linalg.lstsq()
numpy.polyfit(), and scipy.stats.linregress(), but it has not answered my

my goal is to linearly adjust a set of observations (Y) for nuisance
variables (X1 ... Xn), so I can use the adjusted Y values in further
computations. One way to achieve what I want is to do a linear regression,
regressing out the nuisance variables, and saving the residuals (being the
part of Y that's not explained by X).

I see the option full=True returns residuals, but its the sum of the
residuals, whereas I am after the actual residuals on a case by case basis.

is there an option to get the raw residuals? it would save me computing them

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/scipy-user/attachments/20110826/547f0ebc/attachment.html 

More information about the SciPy-User mailing list