Re: [R] Problem with contour(): typo

2020-09-29 Thread Puetz, Benno
As I noted in my earlier post, it does - had checked that ;-) It works by taking corresponding pair fo the input vectors (after possible recycling, as eluded by Helmut in his remark on working on only one vector) as needed for outer. Thanks for the reminder, though, Benno > On 29. Sep

Re: [R] Problem with contour(): typo

2020-09-29 Thread Puetz, Benno
I would assume the following snippet does what you want - note the use of outer with anonymous function wrapping powerTOST: z <- outer(xs, ys, function(x, y)power.TOST(CV = y, theta0 = x, design = "2x2x4", method = "central", n = res[1])) contour(xs, ys, z) Benno > On 29. Sep 2020, at

Re: [R] Problem with contour(): typo

2020-09-29 Thread Helmut Schütz
Dear Duncan and Benno, Duncan Murdoch wrote on 2020-09-29 15:21: On 29/09/2020 9:16 a.m., Puetz, Benno wrote: As I noted in my earlier post, it does - had checked that ;-) Great! The result in all of its "beauty": https://forum.bebac.at/mix_entry.php?id=21930#top21939 THX again! Helmut

Re: [R] Problem with contour(): typo

2020-09-29 Thread Duncan Murdoch
On 29/09/2020 9:16 a.m., Puetz, Benno wrote: As I noted in my earlier post, it does - had checked that ;-) Great! Duncan Murdoch It works by taking corresponding pair fo the input vectors (after possible recycling, as eluded by Helmut in his remark on working on only one vector) as needed

Re: [R] Problem with contour(): typo

2020-09-29 Thread Duncan Murdoch
That won't work unless power.TOST is vectorized. outer() will pass it vectors of x and y values. Duncan Murdoch On 29/09/2020 8:11 a.m., Helmut Schütz wrote: Dear Benno, THX, you made my day! Case closed. Helmut Puetz, Benno wrote on 2020-09-29 13:14: I would assume the following snippet

Re: [R] Problem with contour(): typo

2020-09-29 Thread Helmut Schütz
Dear Benno, THX, you made my day! Case closed. Helmut Puetz, Benno wrote on 2020-09-29 13:14: I would assume the following snippet does what you want - note the use of outer with anonymous function wrapping powerTOST: z <- outer(xs, ys, function(x, y)power.TOST(CV = y, theta0 = x, design =

Re: [R] Problem with contour(): typo

2020-09-29 Thread Helmut Schütz
Dear Duncan, Duncan Murdoch wrote on 2020-09-29 11:57: On 29/09/2020 5:37 a.m., Helmut Schütz wrote: 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(t

Re: [R] Problem with contour(): typo

2020-09-29 Thread Duncan Murdoch
On 29/09/2020 5:37 a.m., Helmut Schütz wrote: Dear Duncan, Duncan Murdoch wrote on 2020-09-28 21:47: You're doing a lot of manipulation of the z matrix; I haven't followed all of it, but that's where I'd look for problems.  Generally if you keep your calculation of the z matrix very simple you

Re: [R] Problem with contour(): typo

2020-09-29 Thread Helmut Schütz
Dear Duncan, Duncan Murdoch wrote on 2020-09-28 21:47: You're doing a lot of manipulation of the z matrix; I haven't followed all of it, but that's where I'd look for problems.  Generally if you keep your calculation of the z matrix very simple you are better off. For example, once you have xs

Re: [R] Problem with contour(): typo

2020-09-28 Thread Duncan Murdoch
You're doing a lot of manipulation of the z matrix; I haven't followed all of it, but that's where I'd look for problems. Generally if you keep your calculation of the z matrix very simple you are better off. For example, once you have xs and ys in the form you want, calculate z as z <- outer

[R] Problem with contour(): typo

2020-09-28 Thread Helmut Schütz
Dear all, sorry, my last message contained a typo. Correct: library(PowerTOST) x    <- 0.90 y    <- 0.35 res  <- as.numeric(sampleN.TOST(theta0 = x, CV = y, design = "2x2x4",     method = "central", details = FALSE,     print = FALSE)[7:8

[R] Problem with contour()

2020-09-28 Thread Helmut Schütz
Dear all, I can't get my head around how contour lines are drawn. Working example(x and y are parameters of a certain test and z the resulting power): library(PowerTOST) x    <- 0.90 y    <- 0.35 res  <- as.numeric(sampleN.TOST(theta0 = x, CV = y, design = "2x2x4",