Quartz | Level 8

WLS - Residuals not equal zero with intercept

Hello,

Please excuse this basic question but the sum of the residuals with the following weighted least squares regression, which includes an intercept, does not equal zero (-0.1025)... Is it normal?

data Work.Sample;
input  x y w;
datalines;
0.0067   13.3832     0.3989422804
0.0133   17.271      0.3946744272
0.02     15.0223     0.3818928999
0.0267   18.1516     0.3614238299
0.0333   13.6427     0.3349933138
0.04     16.6002     0.3033892838
0.0467   16.7669     0.2687428615
;

proc reg data=Work.Sample outest=Work.Coeff tableout noprint;
model y = x;
weight w;
output out=Work.Residuals  r=residuals;
quit;

proc means data=Work.Residuals sum;
var residuals;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
SAS Super FREQ

Re: WLS - Residuals not equal zero with intercept

I assume you mean "is this the expected behavior." Yes. In fact, it's why weighting is useful for robust regression estimates. If an observation is an outlier, you can downweight it. Then the fit doesn't go through the middle of the data anymore.

However, the residuals do still have WEIGHTED means of zero:

proc means data=Work.Residuals sum mean;
var residuals;
weight w;
run;
2 REPLIES 2
SAS Super FREQ

Re: WLS - Residuals not equal zero with intercept

I assume you mean "is this the expected behavior." Yes. In fact, it's why weighting is useful for robust regression estimates. If an observation is an outlier, you can downweight it. Then the fit doesn't go through the middle of the data anymore.

However, the residuals do still have WEIGHTED means of zero:

proc means data=Work.Residuals sum mean;
var residuals;
weight w;
run;
Quartz | Level 8

Re: WLS - Residuals not equal zero with intercept

Thank you so much Rick! I was indeed missing the point that the mean has to be weighted too.
Discussion stats
• 2 replies
• 1846 views
• 1 like
• 2 in conversation