/*----------------------------------------------------------------------------- Macro labs Author : Carolina Meier-Hirmer (cmh@fdm.uni-freiburg.de) Version : 1.0 (13.05.02) Subject : Extracting covariate names for labelling the results (without the current analysed FP) Arguments : j = number of covariate to be labelled mm = degree of the corresponding FP x = content of the makro variable (describes which transformation is currently used) ix = covariable, whis is not wanted to be included names = string containing all variable names se = (0,1,2) without SE, with SE, both Example : Covariates: age nodes er %let names=age tumgrad; %let mvx1= x1_3 x1_5; * Use of macro labs; %labs(2, 2, &mvx1, 2, &names, 2); * Output x1_3="age_1" sex1_3="age_1(SE)" x1_5="age_2" sex1_5="age_2(SE)" -----------------------------------------------------------------------------*/ %macro labs(j, mm, x, ix, names, se); %local hilfe1 hilfe2 labs; %let labs=; %if &j ne &ix %then %do; %if &mm=0 %then %do; %let hilfe1=%qscan(&names, &j, %str( )); %if &se=0 | &se=2 %then %let labs=&labs &x="&hilfe1"; %if &se=1 | &se=2 %then %let labs=&labs se&x="&hilfe1.(SE)"; %end; %if &mm=1 %then %do; %let hilfe2=%qscan(&names, &j, %str( )); %if &se=0 | &se=2 %then %let labs=&labs &x="&hilfe2._p1"; %if &se=1 | &se=2 %then %let labs=&labs se&x="&hilfe2._p1(SE)"; %end; %if &mm=2 %then %do; %let hilfe1=%qscan(&x, 1, %str( )); %let hilfe2=%qscan(&names, &j, %str( )); %if &se=0 | &se=2 %then %let labs=&labs &hilfe1="&hilfe2._p1"; %if &se=1 | &se=2 %then %let labs=&labs %trim(SE&hilfe1="&hilfe2._p1(SE)"); %let hilfe1=%qscan(&x, 2, %str( )); %if &se=0 | &se=2 %then %let labs=&labs &hilfe1="&hilfe2._p2"; %if &se=1 | &se=2 %then %let labs=&labs %trim(SE&hilfe1="&hilfe2._p2(SE)"); %end; %end; &labs %mend;