Date: Wed, 21 Jul 2010 10:42:38 -0700
Reply-To: Jon Matthews <jmatthews7101@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jon Matthews <jmatthews7101@YAHOO.COM>
Subject: Weighted Least Squares Question in SAS
Content-Type: text/plain; charset=iso-8859-1
Hi,
I am using SAS to create a weighted least squares regression, and I've run into
a question about the coefficient of determination when using weighted least
squares regression.
Here is some code I wrote:
data work.temp;
input x y w;
cards;
1 1 1
2 2 1
3 4 1
;
run;
proc reg data=work.temp;
weight w;
model y=x;
run;
quit;
Since the weights are all 1, this is the same as unweighted regression and this
gives me an R-squared of .9643. Note that in my data, the first two
observations are perfectly correlated while the third is not. Now, if I
re-weight the last observation to place less weight on it since it's not
perfectly corrected with the others and rerun the weighted least squares
regression, I get a lower R-squared:
input x y w;
cards;
1 1 1
2 2 1
3 4 .1
;
run;
proc reg data=work.temp;
weight w;
model y=x;
run;
quit;
R-squared now equals .9391.
This does not seem intuitive. Since I'm now underweighting the only
non-perfectly correlated observation, shouldn't R-squared improve or am I
missing something?
Thanks for any insight.
|