15.9 - Analysis - Binary Outcome
15.9 - Analysis - Binary OutcomeSuppose that the response from a crossover trial is binary and that there are no period effects. Then the probabilities of response are:
Failure on B | Success on B | marginal probabilities | |
Failure on A | \(p_{00}\) | \(p_{01}\) | \(p_{0.}\) |
Success on A | \(p_{10}\) | \(p_{11}\) | \(p_{1.}\) |
marginal probabilities | \(p_{.0}\) | \(p_{.1}\) |
The probability of success on treatment A is \(p_{1.}\) and the probability of success on treatment B is \(p_{.1}\) testing the null hypothesis:
\(H_{0} : p_{1.} - p_{.1} = 0\)
is the same as testing:
\(H_{0} : p_{1.} - p_{.1} = (p_{10} + p_{11}) - (p_{01} + p_{11}) = p_{10} - p_{01} = 0\)
This indicates that only the patients who display a (1,0) or (0,1) response contribute to the treatment comparison. For instance, if they failed on both, or were successful on both, there is no way to determine which treatment is better. Therefore we will let:
Failure on B | Success on B | |
Failure on A | \(n_{00}\) | \(n_{01}\) |
Success on A | \(n_{10}\) | \(n_{11}\) |
denote the frequency of responses from the study data instead of the probabilities listed above.
McNemar's test for this situation is as follows. Given the number of patients who displayed a treatment preference, \(n_{10} + n_{01}\) , then \(n_{10}\) follows a binomial \(\left(p, n_{10} + n_{01}\right)\) distribution and the null hypothesis reduces to testing:
\(H_{0} : p = 0.5\)
i.e., we would expect a 50-50 split in the number of patients that would be successful with either treatment in support of the null hypothesis, looking at only the cells where there was success with one treatment and failure with the other. The data in cells for both success or failure with both treatment would be ignored.
SAS® Example
Analysis of the data from a 2x2 crossover for a binary outcome, assuming null period effects
(16.2_-_2x2_crossover__binary.sas )
This is an example of an analysis of the data from a 2 × 2 crossover trial with a binary outcome of failure/success. Fifty patients were randomized and the following results were observed:
Failure on B | Success on B | |
Failure on A | 21 | 15 |
Success on A | 7 | 7 |
Thus, 22 patients displayed a treatment preference, of which 7 preferred A and 15 preferred B. McNemar's test, however, indicated that this was not statistically significant (exact \(p = 0.1338\)).
*************************************************************************
* 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;
A problem that can arise from the application of McNemar's test to the binary outcome from a 2 × 2 crossover trial can occur if there is non-negligible period effects. If that is the case, then the treatment comparison should account for this. This is possible via logistic regression analysis.
The Rationale:
The probability of a 50-50 split between treatment A and treatment B preferences under the null hypothesis is equivalent to the odds ratio for the treatment A preference to the treatment B preference being 1.0. Because logistic regression analysis models the natural logarithm of the odds, testing whether there is a 50-50 split between treatment A preference and treatment B preference is comparable to testing whether the intercept term is null in a logistic regression analysis.
To account for the possible period effect in the 2 × 2 crossover trial, a term for period can be included in the logistic regression analysis.
SAS® Example
Analysis of data from a 2x2 crossover for a binary outcome, assuming nonnull period effects
(16.3_-_2x2_crossover__binary.sas )
Use the same data set from SAS Example 16.2 only now it is partitioned as to patients within the two sequences:
Sequence AB | Failure on B | Success on B |
Failure on A | 10 | 7 |
Success on A | 3 | 5 |
Sequence BA | Failure on B | Success on B |
Failure on A | 11 | 8 |
Success on A | 4 | 2 |
*************************************************************************
* 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;
The logistic regression analysis yielded a nonsignificant result for the treatment comparison (exact \(p = 0.2266\)). There is still no significant statistical difference to report.