I would like to build a logistic model containing two predictors. One from set all_indeps1, and one from all_indeps2. I run below macro, however, it only run model with the first variable from all_indeps1, and all variables from all_indeps2. How should I fix the macro so that I could have all possible combinations of two variables from two sets?
Also, I would like to only output the p-values for each predictors from the logistic model, any ideas?
Many Thanks!
%macro trivariate(all_indeps1, all_indeps2);
%let k = 1;
%let l = 1;
%let indep1 = %scan(&all_indeps1, &k);
%let indep2 = %scan(&all_indeps2, &l);
%do %while("&indep1" NE "");
%do %while ("&indep2" NE "");
title "independent variable is &Indep1 and &Indep2";
proc logistic data = A descending;
model Y = &indep1 &indep2;
run;
%let l = %eval(&l + 1);
%let indep2 = %scan(&all_indeps2, &l);
%end;
%let k = %eval(&k + 1);
%let indep1 = %scan(&all_indeps1, &k );
%end;
%mend;