************************************************************************* * This is an example of an analysis of the data from a 2x2 crossover * * for a binary outcome, assuming nonnull period effects. * *************************************************************************; proc format; value outfmt 0='Failure' 1='Success'; value preffmt 1='A' -1='B'; run; data example; input patient sequence $ treatment_A treatment_B; cards; 01 AB 0 0 02 AB 1 0 03 AB 0 0 04 AB 0 1 05 AB 1 0 06 AB 0 0 07 AB 0 0 08 AB 0 0 09 AB 1 1 10 AB 0 1 11 AB 0 0 12 AB 1 0 13 AB 0 0 14 AB 0 0 15 AB 0 1 16 AB 0 0 17 AB 1 1 18 AB 0 1 19 AB 1 1 20 AB 0 1 21 AB 1 1 22 AB 0 1 23 AB 0 0 24 AB 1 1 25 AB 0 1 26 BA 0 1 27 BA 0 0 28 BA 0 0 29 BA 1 0 30 BA 0 1 31 BA 0 0 32 BA 0 1 33 BA 1 0 34 BA 0 1 35 BA 0 0 36 BA 1 0 37 BA 0 0 38 BA 0 1 39 BA 0 0 40 BA 0 1 41 BA 1 0 42 BA 0 1 43 BA 0 0 44 BA 1 1 45 BA 0 0 46 BA 0 1 47 BA 0 0 48 BA 1 1 49 BA 0 0 50 BA 0 0 ; run; data example2; set example; preference=treatment_A - treatment_B; if preference=0 then delete; format preference preffmt.; if sequence='AB' & preference=1 then period2=0; if sequence='AB' & preference=-1 then period2=1; if sequence='BA' & preference=1 then period2=1; if sequence='BA' & preference=-1 then period2=0; run; proc logistic data=example2; model preference=period2; exact 'intercept' intercept; exact 'period2' period2; title "Logistic Regression Analysis for a Binary Outcome in a 2 x 2 Crossover Trial"; run;