Skip to content
Prev 385817 / 398503 Next

Problem with contour(): typo

Dear Duncan,

Duncan Murdoch wrote on 2020-09-28 21:47:
Here I'm lost. power.TOST(theta0, CV, ...) vectorizes properly for 
theta0 _or_ CV but no _both_. Hence
library(PowerTOST)
power.TOST(theta0 = c(0.9, 0.95, 1), CV = 0.25, n = 28)
and
power.TOST(theta0 = 0.95, CV = c(0.2, 0.25, 0.3), n = 28)
work, whereas
power.TOST(theta0 = c(0.9, 0.95, 1), 0.95, CV = c(0.2, 0.25, 0.3), n = 28)
not. Of note, we will throw an error in the next release if both 
arguments are vectors.
I tried
f <- function(x, y) {
 ? power.TOST(theta0 = x, CV = y, n = 28)
}
x <- unique(sort(c(0.95, seq(0.95*0.95, 1, length.out = 28))))
y <- unique(sort(c(0.25, seq(0.25*0.8, 0.25*1.2, length.out = 28))))
Vectorize(f, c("x, y"), SIMPLIFY = "array")
which is obviously not correct.

Helmut