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 (July 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 14 Jul 2005 16:14:30 +0000
Reply-To:   toby dunn <tobydunn@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   toby dunn <tobydunn@HOTMAIL.COM>
Subject:   Re: SIMPLE MACRO QUESTION?
Comments:   To: Kevin.F.Spratt@DARTMOUTH.EDU
In-Reply-To:   <6.0.1.1.2.20050714114815.0442c818@newdonner.dartmouth.edu>
Content-Type:   text/plain; format=flowed

Kevin,

Don't know that I have reached the Macro Mavenship or Macro Master level yet. But looking at your code and what you want I'd say looks like good to me provided you have that %do loop inside of a %macro definition. I don't think I would bother with renaming your vars for the sake of teh loop they are already named well enough to allow the loop to do its job without any extra effort due to the name.

The title would be easy put something like this inside of your %do loop. title "Logistic regression for data AAA where predictor variable is CM&I. " ;

I am not a stats guy per se, and therefore don't know if there is an easier way to get what you want from proc logistics. I am pretty darn sure given your title statement request that there isn't but hey I could be wrong here.

Toby Dunn

From: "Kevin F. Spratt" <Kevin.F.Spratt@DARTMOUTH.EDU> Reply-To: "Kevin F. Spratt" <Kevin.F.Spratt@DARTMOUTH.EDU> To: SAS-L@LISTSERV.UGA.EDU Subject: SIMPLE MACRO QUESTION? Date: Thu, 14 Jul 2005 12:00:21 -0400

Running SAS 9.1 under Windows.

I want to run two sets of 46 separate logistic regressions identical except of the predictor.

for cm01 - cm46 ( I COULD RENAME THESE TO CM1-CM46 TO ALLOW EASIER &I LOOPING)

My naive notion is something like this:

%DO &I = 1 TO 46;

PROC LOGISTIC DATA=WORK.A SIMPLE ALPHA=.01 ; ;

CLASS CM&I

GENDER AGE_C3 RACE_C5 PAY_C4 TIME_C / PARAM=GLM;

MODEL TNT =CM&I

GENDER AGE_C3 RACE_C5 PAY_C4 TIME_C ISS / SELECTION=NONE ;

CONTRAST 'CM: 1 > 0' CM&I -1 1 / ESTIMATE=EXP;

%END;

It would be nice to include a title that changes with the cm variable.

Macro mavens, some clarity please.

______________________________________________________________________

Kevin F. Spratt, Ph.D. Department of Orthopaedic Surgery Rubin 561 One Medical Center Drive Lebanon, NH 03756-0001

(603) 653-6012 (voice) (603) 653-6013 (fax) Kevin.F.Spratt@Dartmouth.Edu (e-mail) _______________________________________________________________________


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