comparison of 2 groups in multivariate logistic regression

#1
I have successfully generated the following macro for differences of differences (2 procedures, 2 time periods) in a multivariate logistic regression model. However, how do I take a step back to compare just the 2 time periods (regardless of procedure) and get p values and odds ratios for the comparison? I thought this would be the easier part.

* Perform multivariate regression on predictors of readmission, reoperation, and morbidity for differences of differences in Tables 3-5;
%macro logodds(var);
proc logistic data=data09_19;
class time proc race_o smoking hypertension dial ASA_ge3 plf_adj rev_surg / param=glm ref=first;
model &var(event="1") = time proc time*proc age1 race_o smoking hypertension dial ASA_ge3 tothlos plf_adj rev_surg;
lsmeans time*proc / e ilink adjust=bon;
lsmestimate time*proc "Diff in Diff LogOdds" 1 -1 -1 1;
ods output modelanova=anova oddsratios=odds;
store log;
proc print data=anova;
proc print data=odds;
proc export data=anova
outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&var._anova.xls"
dbms=xls replace;
proc export data=odds
outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&var._odds.xls"
dbms=xls replace;
run;
%mend logodds;
%logodds(readm_c);
%logodds(reop_c);
%logodds(morbidity_c);
run;
 
#2
I ended up cleaning up the redundancy in the above macro and coming up with the second one below in answer to my own question. Does anybody have any comments?


* Perform multivariate regression on predictors of readmission, reoperation, and morbidity for differences of differences in Tables 3-5;
%macro logodds(var);
proc logistic data=data09_19;
class time proc race_o smoking hypertension dial ASA_ge3 plf_adj rev_surg / param=glm ref=first;
model &var(event="1") = time proc time*proc age1 race_o smoking hypertension dial ASA_ge3 tothlos plf_adj rev_surg;
lsmeans time*proc / e ilink diff oddsratio cl adjust=bon;
ods output modelanova=anova oddsratios=odds;
store log;
proc print data=anova;
proc print data=odds;
proc export data=anova
outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&var._anova.xls"
dbms=xls replace;
proc export data=odds
outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&var._odds.xls"
dbms=xls replace;
run;
%mend logodds;
%logodds(readm_c);
%logodds(reop_c);
%logodds(morbidity_c);
run;


* Perform multivariate regression on predictors of readmission, reoperation, and morbidity to compare time periods within each surgical approach in Tables 3-5;
%macro logodds_times(var,prc);
proc logistic data=data09_19;
class time proc race_o smoking hypertension dial ASA_ge3 plf_adj rev_surg / param=glm ref=first;
model &var(event="1") = time proc time*proc age1 race_o smoking hypertension dial ASA_ge3 tothlos plf_adj rev_surg;
where proc=&prc;
lsmeans time*proc / e ilink diff oddsratio cl adjust=bon;
ods output modelanova=anova oddsratios=odds;
store log;
proc print data=anova;
proc print data=odds;
proc export data=anova
outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&var&prc._anova_times.xls"
dbms=xls replace;
proc export data=odds
outfile="E:\LogonData\UserFolders\sarinm\anterior_vs_posterior_fusion\&var&prc._odds_times.xls"
dbms=xls replace;
run;
%mend logodds_times;
%logodds_times(readm_c,1);
%logodds_times(readm_c,2);
%logodds_times(reop_c,1);
%logodds_times(reop_c,2);
%logodds_times(morbidity_c,1);
%logodds_times(morbidity_c,2);
run;