Calculate the type I error or power of a multinomial (response and disease progression) single- or two-stage design under UIT:
*H_0: p_1 ≤ p_{01} \ AND \ p_2 ≥ p_{02} \ versus \ H_1: p_1 ≥ p_{11} > p_{01} \ OR \ p_2 ≤ p_{12} < p_{02}*
(Note: original Zee et al. (1999) set up the correct hypotheses, but did not make a match decision.)

1 2 | ```
UIT.power(method, s1.rej, t1.rej, s1.acc, t1.acc, n1, s2.rej, t2.rej, n2, p.s, p.t,
output.all)
``` |

`method` |
design methods according to number of stage and stopping rule, "s1" represents single-stage design stopping for both efficacy and futility, "s2" represents two-stage design stopping for both efficacy and futility, "s2.f" represents two-stage design stopping for futility only. |

`s1.rej` |
first stage responses threshold to stop the trial for efficacy. Applied for "s1" or "s2". |

`t1.rej` |
first stage disease progressions threshold to stop the trial for efficacy. Applied for "s1" or "s2". |

`s1.acc` |
first stage responses threshold to stop the trial for futility. Applied for "s2" or "s2.f". |

`t1.acc` |
first stage disease progressions threshold to stop the trial for futility. Applied for "s2" or "s2.f". |

`n1` |
first stage sample size. Applied for "s1", "s2" or "s2.f". |

`s2.rej` |
second stage responses threshold to stop the trial for efficacy. Applied for "s2" or "s2.f". |

`t2.rej` |
second stage disease progressions threshold to stop the trial for efficacy. Applied for "s2" or "s2.f". |

`n2` |
second stage sample size. Applied for "s2" or "s2.f". |

`p.s` |
pre-specified response rate, |

`p.t` |
pre-specified disease progression rate, |

`output.all` |
logical, if FALSE (default), only output the value of power or type I error, otherwise, also output the probability of early termination (PET) and expected sample size (EN). Applied for "s2" or "s2.f". |

`prob` |
the power function |

Zee, B., Melnychuk, D., Dancey, J., & Eisenhauer, E. (1999).
*Multinomial phase II cancer trials incorporating response and early progression.*
*Journal of biopharmaceutical statistics, * **9(2),** 351-363.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
p01=0.1; p02=0.9
## Calculate type I error for single-stage design
UIT.power(method="s1", s1.rej=6, t1.rej=19, n1=25, p.s=p01, p.t=p02)
## Calculate power for single-stage design
UIT.power(method="s1", s1.rej=6, t1.rej=19, n1=25, p.s=p01+0.2, p.t=p02-0.2)
## Calculate type I error for two-stage design, output PET and EN under null hypothesis
UIT.power(method="s2", s1.rej=4, t1.rej=9, s1.acc=0, t1.acc=13, n1=13,
s2.rej=6, t2.rej=18, n2=11, p.s=p01, p.t=p02, output.all=TRUE)
## Calculate power for two-stage design
UIT.power(method="s2", s1.rej=4, t1.rej=9, s1.acc=0, t1.acc=13, n1=13,
s2.rej=6, t2.rej=18, n2=11, p.s=p01+0.2, p.t=p02-0.2)
## Calculate type I error for two-stage design stopping for futility only,
## output PET and EN under null hypothesis
UIT.power(method="s2.f", s1.acc=0, t1.acc=13, n1=13,
s2.rej=6, t2.rej=18, n2=11, p.s=p01, p.t=p02, output.all=TRUE)
## Calculate power for two-stage design
UIT.power(method="s2.f", s1.acc=0, t1.acc=13, n1=13,
s2.rej=6, t2.rej=18, n2=11, p.s=p01+0.2, p.t=p02-0.2)
``` |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.