## a bug in interim.tsd.in()? [Two-Stage / GS Designs]

Dear mittyri,

» I tried to simulate some data to show the approach of safety net with inverse normal vs fixed (Helmut is right, it is very popular in Russia last days as my colleagues said; of course the Sponsors are using Potvin C )

I hope Sponsors will be using the Inverse Normal approach in near future

» But my loop was interrupted:

»

»

» What is going on here?

Thank you for that. Indeed, a bug. The underlying cause is the fact that the power of stage 1 is > 0.8 (in your example it is 0.8226768). That means we actually fall into the futility criterion "BE at interim not achieved

I have corrected this bug on GitHub and it will be part of the next release.

General remark here: In your example we see that BE has not been achieved only marginally. The Repeated CI is (0.79215, 0.99993). Even though the power of stage 1 is large enough so that we formally conclude futility, one could question whether it is really a good idea to stop the trial due to futility. On the other hand: If we want to have this futility criterion then we need a cut-off threshold, and at some point this cut-off will be met...

Best regards,

Ben.

» I tried to simulate some data to show the approach of safety net with inverse normal vs fixed (Helmut is right, it is very popular in Russia last days as my colleagues said; of course the Sponsors are using Potvin C )

I hope Sponsors will be using the Inverse Normal approach in near future

» But my loop was interrupted:

»

`interim.tsd.in(GMR1=0.89, CV1=0.2575165, n1=38)`

`» Error in tval[, 1] : incorrect number of dimensions`

» In addition: Warning messages:

» 1: In qnorm(p2) : NaNs produced

» 2: In min(df) : no non-missing arguments to min; returning Inf

»

» What is going on here?

Thank you for that. Indeed, a bug. The underlying cause is the fact that the power of stage 1 is > 0.8 (in your example it is 0.8226768). That means we actually fall into the futility criterion "BE at interim not achieved

**and**power of stage 1 is > 0.8" (this criterion was carried over from the Potvin et al decision tree). Instead of just stopping all the procedures (due to futility),`interim.tsd.in `

proceeded and still wanted to calculate n2. This is however not possible because the estimated conditional target power is only defined if the power of stage 1 is greater than the overall power (argument `targetpower`

). If you still try to calculate it, you will end up with a negative estimated conditional target power which will then be put into the sample size routine as input target power - which of course will fail.I have corrected this bug on GitHub and it will be part of the next release.

General remark here: In your example we see that BE has not been achieved only marginally. The Repeated CI is (0.79215, 0.99993). Even though the power of stage 1 is large enough so that we formally conclude futility, one could question whether it is really a good idea to stop the trial due to futility. On the other hand: If we want to have this futility criterion then we need a cut-off threshold, and at some point this cut-off will be met...

Best regards,

Ben.

### Complete thread:

- Finally: Exact TSD methods for 2×2 crossover designs Helmut 2018-04-21 17:17
- Exact TSD methods: Example Helmut 2018-04-21 20:33
- Finally: Exact TSD methods for 2×2 crossover designs ElMaestro 2018-04-21 20:49
- Flow chart (without details) Helmut 2018-04-21 21:41
- naive questions regarding new functions in Power2Stage mittyri 2018-04-28 15:54
- Some answers Helmut 2018-04-28 17:29
- Some more "answers" d_labes 2018-04-29 21:11
- clarification regarding user Power2Stage guides mittyri 2018-04-30 13:41

- naive questions regarding new functions in Power2Stage mittyri 2018-04-28 15:54

- Flow chart (without details) Helmut 2018-04-21 21:41
- Technicality: Weigths for the inverse normal approach d_labes 2018-04-25 14:19
- Selection of w and w* Helmut 2018-04-26 09:51
- Selection of w and w* d_labes 2018-04-26 20:02
- Now what? w & w* examples d_labes 2018-05-09 13:53
- Now what? w & w* examples Ben 2018-06-10 20:12
- Now what? w & w* examples Helmut 2018-06-11 13:57
- Now what? w & w* examples Ben 2018-06-12 19:14

- a bug in interim.tsd.in()? mittyri 2018-06-11 23:27
- a bug in interim.tsd.in()?Ben 2018-06-12 19:32
- Nonbinding futility rule d_labes 2018-06-13 16:59
- Bad weather? Helmut 2018-06-13 19:23
- NLYW? d_labes 2018-06-14 10:18

- Nonbinding futility rule Ben 2018-06-13 20:26
- Nonbinding futility rule d_labes 2018-06-14 10:47
- Nonbinding futility rule Ben 2018-06-15 17:58
- Binding / Nonbinding futility rule - alpha control d_labes 2018-06-16 19:42
- Binding / Nonbinding futility rule - alpha control Ben 2019-03-30 09:52

- Binding / Nonbinding futility rule - alpha control d_labes 2018-06-16 19:42

- Nonbinding futility rule Ben 2018-06-15 17:58

- Nonbinding futility rule d_labes 2018-06-14 10:47

- Bad weather? Helmut 2018-06-13 19:23

- Nonbinding futility rule d_labes 2018-06-13 16:59

- a bug in interim.tsd.in()?Ben 2018-06-12 19:32

- Now what? w & w* examples Helmut 2018-06-11 13:57

- Now what? w & w* examples Ben 2018-06-10 20:12

- Selection of w and w* Helmut 2018-04-26 09:51