# getCP: Calculates the conditional power. In OneArmPhaseTwoStudy: Planning, Conducting, and Analysing Single-Arm Phase II Studies

## Description

Calculates the conditional power for a given Simon's two-stage design in the interim analysis if the number of patients which should be enrolled in the second stage is altert to "n2".

## Usage

 `1` ```getCP(n2, p1, design, k, mode = 0, alpha = 0.05) ```

## Arguments

 `n2` number of patients to be enrolled in the second stage of the study. `p1` response probability under the alternative hypothesis `design` a dataframe containing all critical values for a Simon's two-stage design defined by the colums "r1", "n1", "r", "n" and "p0". r1 = critical value for the first stage (more than r1 responses needed to proceed to the second stage). n1 = number of patients enrolled in the first stage. r = critical value for the whole trial (more than r responses needed at the end of the study to reject the null hypothesis). n = number of patients enrolled in the whole trial. p0 = response probability under the null hypothesis. `k` number of responses observed at the interim analysis. `mode` a value out of {0,1,2,3} dedicating the methode spending the "rest alpha" (difference between nominal alpha level and actual alpha level for the given design). 0 = "rest alpha" is not used. 1 = "rest alpha" is spent proportionally. 2 = "rest alpha" is spent equally. 3 = "rest alpha" is spent only to the worst case scenario (minimal number of responses at the interim analysis so that the study can proceed to the second stage). `alpha` overall significance level the trial was planned for.

## References

Englert S., Kieser M. (2012): Adaptive designs for single-arm phase II trials in oncology. Pharmaceutical Statistics 11,241-249.

`getN2`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27``` ```#Calculate a Simon's two-stage design design <- getSolutions()\$Solutions[3,] #minimax-design for the default values. #Assume 3 responses were observed in the interim analysis. #Therefore the conditional power is only about 0.55. #In order to raise the conditional power to 0.8 "n2" has to be increased. #get the current "n2" n2 <- design\$n - design\$n1 #set k to 3 (only 3 responses observed so far) k = 3 #get the current conditional power cp <- getCP(n2, design\$p1, design, k, mode = 1, alpha = 0.05) cp #increase n2 until the conditional power is larger than 0.8 while(cp < 0.8){ n2 <- n2 + 1 # Assume we spent the "rest alpha" proportionally (in the planning phase) # therefore we set "mode = 1". cp <- getCP(n2, design\$p1, design, k, mode = 1, alpha = 0.05) } n2 ```