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 (October 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 17 Oct 2007 16:45:06 -0500
Reply-To:     Mary <mlhoward@avalon.net>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Mary <mlhoward@AVALON.NET>
Subject:      Re: Use all numeric variables as predictors in proc reg
Comments: To: ginanicolosi@HOTMAIL.COM
Content-Type: text/plain; charset="iso-8859-1"

Hi, Gina,

You could try something like this (not exact):

-Mary

proc sql;

describe table dictionary.columns;

quit;

run;

proc sql;

create table num_vars as

select name, informat

from dictionary.columns

where memname='RESULTS5' and

libname='WORK';

quit;

{then get a random number of observations from

the data set num_vars; let's say we put it in

a data set called num_vars_subset }

{Then put the names in num_vars_subset into

a macro variable }

proc sql;

select name

into :random_vars

from num_vars_subset;

quit;

Then use your macro variable to run against the model:

proc reg;

model result= &random_vars;

run;

----- Original Message ----- From: Gina Nicolosi To: SAS-L@LISTSERV.UGA.EDU Sent: Tuesday, October 16, 2007 3:44 PM Subject: Use all numeric variables as predictors in proc reg

I am writing a program which randomly selects predictor variables to be included in a regression. Since the predictors during any one iteration can change, I can't write them out in the MODEL statement. Therefore, I was wondering if there was any way to specify that all numeric variables in the data set act as regressors? Kind of like putting _ALL_ or _NUMERIC_ after the equals sign when running PROC REG (but this approach doesn't work). Any guidance would be greatly appreciated.


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