LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 1998, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 27 May 1998 21:14:46 GMT
Reply-To:     jshi@KUHUB.CC.UKANS.EDU
Sender:       "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:         Jingren Shi <jshi@KUHUB.CC.UKANS.EDU>
Organization: Deja News - The Leader in Internet Discussion
Subject:      Re: Model selection in PROC REG

In article <35696FA2.2F06@ukc.ac.uk>, "M.M.Iqbal" <mmi1@ukc.ac.uk> wrote: > > Hello all, > > I am using following code to select a model of size 7 using > SELECTION=RSQUARE in model statement. > > proc reg data = dataset; > model y = list of independent variables/selection=rsquae > start=7 stop=7; > run; > > It works for me and give me a list of models in descending order of R^2. > In my particular case first model is reported to have R^2=0.89. When I > try to fit the selected model using PROC REG or PROC GLM it gives me R^2 > as low as about 0.29. > > I am wondering what makes SAS to calculate different R^2 for the same > model. > > I tried to figure out the reason behind this difference by calculating > residuals for every intermediate model but remained fail to get it as > use of OUTPUT OUT=MYOUTPUT P=PREDICT R=RESID; gives the information for > the last model only. > > Any help would be appreciated. > > Iqbal > Iqbal, I did a sample dataset and ran the approach you did. I got the same result --- R-sqs are the same. If you can e-mail me your data, I would like to take a look. Good luck.

data t1; do i = 1 to 100; x1=i+sin(i); x2=-sin(i); x3=30+2*cos(i); x4=30+i**2; y= 5+3*i+rannor(0); output; end; run;

proc reg data=t1; l1: model y = x1 x2 x3 x4/ selection=RSQUARE start=2 stop =2; quit; run;

proc reg data=t1; l1: model y = x1 x2; quit; run;

proc glm data=t1; model y = x1 x2; quit; run;

-----== Posted via Deja News, The Leader in Internet Discussion ==----- http://www.dejanews.com/ Now offering spam-free web-based newsreading


Back to: Top of message | Previous page | Main SAS-L page