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;
* 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;