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;
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;
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;
Catch the best of SAS Innovate 2025 — anytime, anywhere. Stream powerful keynotes, real-world demos, and game-changing insights from the world’s leading data and AI minds.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.