DATA Step, Macro, Functions and more

Proc Logsitic Macro for reference values? Help!

Reply
N/A
Posts: 0

Proc Logsitic Macro for reference values? Help!

I am trying to run Odds Ratios on 11 different outcomes with 64 variables. I got my macro working, but the problem is that some of the variables I would like to have a different reference value for. Ex. variable sex (ref='m') or variable race (ref='white')....anyways I made a macro for the references that match in order the variables. When I run it, the macro tries to reference each variable 64 times, rather than just once and then move on to the next. Take a look at my code....any help?

%let outcome1=leukemias;
%let outcome2=lymphomas;
%let outcome3=cns;
%let outcome4= neuroblastoma;
%let outcome5=retinoblastoma;
%let outcome6=renal;
%let outcome7=hepatic;
%let outcome8=bone;
%let outcome9=soft_tissue;
%let outcome10=germ_cell;
%let outcome11=other_cancer;

%let var1=sex;
%let var2=age_groups;
%let var3=birth_cat;
%let var4=race_group;
%let var5=healthdistrict;
%let var6=urbanrural;
%let var7=birthorder;
%let var8=famsize;
%let var9=bweight_cat;
%let var10=gest_cat;
%let var11=maocc_cat;
%let var12=paocc_cat;
%let var13=maedu_cat;
%let var14=paedu_cat;
%let var15=ma_age_cat;
%let var16=pa_age_cat;
%let var17=maheight_cat;
%let var18=mabmi_cat;
%let var19=matobacco;
%let var20=smoke;
%let var21=cig1_cat;
%let var22=cig2_cat;
%let var23=cig3_cat;
%let var24=cigoverall_cat;
%let var25=maalcohol;
%let var26=alcohol;
%let var27=drink1_cat;
%let var28=drink2_cat;
%let var29=drink3_cat;
%let var30=drinkoverall_cat;
%let var31=apgar1_cat;
%let var32=apgar5_cat;
%let var33=termination;
%let var34=weightgain;
%let var35=conditions1;
%let var36=conditions2;
%let var37=conditions3;
%let var38=conditions4;
%let var39=conditions5;
%let var40=conditions6;
%let var41=conditions7;
%let var42=conditions8;
%let var43=conditions9;
%let var44=conditions10;
%let var45=conditions11;
%let var46=conditions12;
%let var47=conditions13;
%let var48=conditions14;
%let var49=conditions15;
%let var50=conditions16;
%let var51=conditions17;
%let var52=conditions18;
%let var53=conditions19;
%let var54=conditions20;
%let var55=conditions21;
%let var56=conditions22;
%let var57=conditions23;
%let var58=conditions24;
%let var59=conditions25;
%let var60=conditions26;
%let var61=conditions27;
%let var62=conditions28;
%let var63=conditions29;
%let var64=conditions30;

%let ref1='M';
%let ref2='5';
%let ref3='1';
%let ref4='white';
%let ref5='Salt Lake';
%let ref6='2';
%let ref7='1';
%let ref8='1';
%let ref9='2';
%let ref10='2';
%let ref11='1';
%let ref12='1';
%let ref13='2';
%let ref14='2';
%let ref15='1';
%let ref16='1';
%let ref17='2';
%let ref18='2';
%let ref19='1';
%let ref20='1';
%let ref21='3';
%let ref22='3';
%let ref23='3';
%let ref24='3';
%let ref25='1';
%let ref26='1';
%let ref27='3';
%let ref28='3';
%let ref29='3';
%let ref30='3';
%let ref31='2';
%let ref32='2';
%let ref33='4';
%let ref34='4';
%let ref35='0';
%let ref36='0';
%let ref37='0';
%let ref38='0';
%let ref39='0';
%let ref40='0';
%let ref41='0';
%let ref42='0';
%let ref43='0';
%let ref44='0';
%let ref45='0';
%let ref46='0';
%let ref47='0';
%let ref48='0';
%let ref49='0';
%let ref50='0';
%let ref51='0';
%let ref52='0';
%let ref53='0';
%let ref54='0';
%let ref55='0';
%let ref56='0';
%let ref57='0';
%let ref58='0';
%let ref59='0';
%let ref60='0';
%let ref61='0';
%let ref62='0';
%let ref63='0';
%let ref64='0';




%macro proclogistic;

%do i=1 %to 11;
%do j=1 %to 64;
%do k=1 %to 64;

proc logistic data=f.merged12;
class race_group healthdistrict &&var&j (ref=&&ref&k);
strata caseid;
model &&outcome&i(event='1')= race_group healthdistrict &&var&j;

run;

%end;
%end;
%end;


%mend proclogistic;

%proclogistic;
N/A
Posts: 0

Re: Proc Logsitic Macro for reference values? Help!

Posted in reply to deleted_user
nevermind....figured it out, lol....needed to reference my "macro reference values' to my variables, rather than write a new loop...
Ask a Question
Discussion stats
  • 1 reply
  • 103 views
  • 0 likes
  • 1 in conversation