Sensitivity analysis for all ABE designs [Power / Sample Size]
❝ Maybe there is a better solution than pasting the function into the R-console: Incorporating it into PowerTOST
.
Up to you. My primary aim was an educational one – such questions regularly pop up at my workshops and end up in eyes wide opened in disbelief.

❝ May need some additional effort for checking the input and some effort for documenting.
❝ May need also some thinking about the return value(s) of the function.
Yessir. A tabular output would be nice. The plots are less than ideal yet.
❝ BTW: What did you mean by your sentence in your post above "This little exercise is not a substitute for the sensitivity analysis which should be performed in study planning ..."? Sens() not useful in real life?
Only as a “first look” since one of the parameters is varied in each case and the respective others are still “carved from stone”. My understanding of a sensitivity analysis is to explore their combinations, i.e., playing games like:
“What happens to power if we have x drop-outs, the CV increases to y% and the GMR shifts by z?”
In my protocols I use to come up with a couple of “plausible” ones.Let’s think about my first example, planning for 90% and aiming at a minimum acceptable power for each parameter of 80% this time. That would translate into CV 20⇒24.25%, GMR 0.95⇒0.9208, and n 26⇒19. Although the worst case is possible, it is not realistic.
power2.TOST(CV=0.2425, theta0=0.9208, n=c(10, 9))
[1] 0.520466I don’t think that there is an easy (automatic) solution. One could set a lower limit for the power of individual parameters (say 70%) and with a shotgun-simulation explore combinations which will prevent the power to drop below 80%. Such a simulation must also allow parameters to vary towards “better” values. Tricky.
BTW, I knew that the GMR is such a “Prinzessin auf der Erbse”, but was surprised how sensitive (compared to the others) she is. Maybe we could consider to throw the upper CL of the CV into the waste-bin and work with the CI of the GMR (with a high α = the producer’s risk here)?
In my first example we get:
2x2 design:
CV=20%, GMR=0.9500, n=26, expected power=91.76% (>target of 90%)
require(PowerTOST)
alpha <- 0.2
CV <- 0.2
GMR <- 0.95
n <- 26
des <- "2x2"
CI <- as.numeric(CI.BE(alpha=alpha, CV=CV, pe=GMR, n=n, design=des))
delta <- abs(CI-1)
lim <- c("Lower", "Upper")
ifelse(delta[1] > delta[2], j <- 1, j <-2)
cat(sprintf("%s %s%5.4f%s %5.4f%s", lim[j], "CL of GMR=",
GMR, ":", CI[j], "\n"))
Lower CL of GMR=0.9500: 0.9063
Interesting.
❝ ❝ Note that the code tries to keep the degree of imbalance as close as possible between sequences. In real life 
❝
❝ This is surely a minor shortcoming of your code. But if we assume drop-outs by random its a reasonable attempt I think in the planning phase where we don't have 'real life' data. And at least I have no "better" idea.
Agree.
❝ ❝ @R-Freaks: The construction of imbalanced sequences is both lengthy and clumsy. Any suggestions are welcome. 
❝
❝ Will try it if time allows
.
❝ Idea: use number of sequences = steps from known.designs() and make a general solution of the n's in sequence groups - looping over sequences.
Yes, I thought along these lines as well. No spare time at the moment… On the other hand if the code is capsuled in your famous package who cares how elegant it might be? Bringing the execution time down by a fraction of second does not really matter.
❝ ❝ * If a sequence is completely lost, power2.TOST() – correctly? – gives power=0. […]
❝ If this is truly correct? Don't think so.
Me not either.

❝ Simply the design changes to another one […] Not in known.designs()!
❝ Eventually power2.TOST() should throw an error/warning if it encounters some n's = zero.
Would make sense, IMHO.
Dif-tor heh smusma 🖖🏼 Довге життя Україна!
![[image]](https://static.bebac.at/pics/Blue_and_yellow_ribbon_UA.png)
Helmut Schütz
![[image]](https://static.bebac.at/img/CC by.png)
The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
Complete thread:
- Deviating from assumptions Helmut 2014-08-08 15:44
- Some Nitpicking d_labes 2014-08-12 09:12
- Some Nitpicking Helmut 2014-08-12 10:49
- R-code for all ABE designs Helmut 2014-08-12 17:21
- Sensitivity analysis for all ABE designs d_labes 2014-08-13 09:30
- Sensitivity analysis for all ABE designsHelmut 2014-08-13 14:49
- R-code shortening d_labes 2014-08-13 16:32
- Suggestions / Sneak Preview Helmut 2014-08-13 16:42
- Suggestions / Sneak Preview d_labes 2014-08-15 09:01
- Suggestions / Sneak Preview Helmut 2014-08-15 12:02
- Mehl returned! d_labes 2014-08-15 11:27
- Mehl returned! Helmut 2014-08-15 11:42
- Suggestions / Sneak Preview d_labes 2014-08-15 09:01
- Suggestions / Sneak Preview Helmut 2014-08-13 16:42
- Sensitivity analysis for all ABE designs d_labes 2014-08-13 09:30
- Some Nitpicking d_labes 2014-08-12 09:12
