************************************************************************* * This is an example of an analysis of the data from a 2x2 crossover * * for a binary outcome, assuming null period effects. * *************************************************************************; proc format; value outfmt 0='Failure' 1='Success'; run; data example; input patient sequence $ treatment_A treatment_B; format treatment_A treatment_B outfmt.; 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; proc freq data=example; tables treatment_A*treatment_B/agree; exact McNem; title "McNemar's Test for a Binary Outcome in a 2 x 2 Crossover Trial"; run;