Shuanghe
★★  

Spain,
2016-01-25 18:49
(2984 d 14:46 ago)

Posting: # 15852
Views: 18,533
 

 PowerTOST sample size FDA full replicate T/R ratio at 85% [🇷 for BE/BA]

Hi all,

I just noticed some strange result when I was making sample size plot for FDA full replicate BE using Detlew's famous PowerTOST.

My understanding was that, with T/R ratio fixed (e.g., 90%), when ISCV increase from, say, 10% to 100%, sample size will increase with the increasing ISCV and reach a peak at ISCV=30% then sample size will decrease due to widened BE criteria and after a certain point size will increase again due to high variability. This is true when I tried T/R ratio of 95% or 90%. For example, this plot.

[image]

However, when I was trying T/R ratio of 85% (I know, weird and problematic ratio assumption for BE. Don't ask why. Let's just say that I had to do it), the size peak reached at ISCV=27-28%, not at 30%. See this picture.

[image]


Why is that? Since all other assumptions are same (e.g., T/R ratio is still 85%), when ISCV increased from e.g., 28% to 29% and 30%, shouldn't we need more subjects as the BE criteria is not widened yet?

If my understanding is correct, then maybe it's a bug of the package? If I'm wrong, could anyone explain it in plain English :-D ? Many thanks.


Edit: Category changed. [Helmut]

All the best,
Shuanghe
d_labes
★★★

Berlin, Germany,
2016-01-26 13:05
(2983 d 20:29 ago)

@ Shuanghe
Posting: # 15853
Views: 16,840
 

 PowerTOST sample size FDA full replicate T/R ratio at 85%

Dear Shuange!

❝ Why is that?


The why is not so easy to answer. It is a result of a complex interplay of the dependence of the linearized RSABE criterion from GMR and CVwR and of the additional point estimate constraint. My suggestion: Take the observed effect as is :cool:.

❝ Since all other assumptions are same (e.g., T/R ratio is still 85%), when ISCV increased from e.g., 28% to 29% and 30%, shouldn't we need more subjects as the BE criteria is not widened yet?


"Not widened yet" is the false. Think from the underlying method - simulation of studies with true CV and true GMR = theta0. And think further in terms of widened acceptance limits:
If we simulate with CV=30% we have realizations where the implied acceptance limits are wider and others where the conventional acceptance limits have to be used. The probability of both studies is 0.5. If we go to smaller CV's the proportion with wider implied acceptance limits decreases. For higher CV's we get more studies with wider implied acceptance limits.

So far so good. This doesn't imply that at CV=30% the sample size is highest since we have the point estimate constraint in effect. This leads to the shift of the maximum sample size downwards of 30%. This is also the case for your calculations with theta0=0.9, but not so pronounced seen as with theta0=0.85. Check it by power calculations with n=120 for theta0=0.85 or theta0=0.9 and n=32. You will find the minimum (implying max. sample size) below CV=30% in both cases.

❝ If my understanding is correct, then maybe it's a bug of the package?


Of course not! Even the suspicion is an injury :-D!
It must be correct because PowerTOST says so :cool:.

Count up: post 995

Regards,

Detlew
Shuanghe
★★  

Spain,
2016-01-26 13:55
(2983 d 19:39 ago)

@ d_labes
Posting: # 15854
Views: 16,703
 

 PowerTOST sample size FDA full replicate T/R ratio at 85%

Many thanks Detlew!

❝ "Not widened yet" is the false. ...


❝ So far so good. This doesn't imply that at CV=30% the sample size is highest since we have the point estimate constraint in effect. This leads to the shift of the maximum sample size downwards of 30%.


Understood until here.

❝ This is also the case for your calculations with theta0=0.9, but not so pronounced seen as with theta0=0.85. Check it by power calculations with n=120 for theta0=0.85 or theta0=0.9 and n=32. You will find the minimum (implying max. sample size) below CV=30% in both cases.


Confused by this part. :confused:

❝ The why is not so easy to answer. ... My suggestion: Take the observed effect as is :cool:.


I think I'll just take what it is as you said. Much easier this way :-D

❝ Of course not! Even the suspicion is an injury :-D!

❝ It must be correct because PowerTOST says so :cool:.


:ok: :clap:

All the best,
Shuanghe
d_labes
★★★

Berlin, Germany,
2016-01-26 15:07
(2983 d 18:27 ago)

@ Shuanghe
Posting: # 15855
Views: 16,744
 

 PowerTOST sample size FDA full replicate T/R ratio at 85%

Dear Shuanghe,

❝ Many thanks Detlew!


You are welcome.

❝ ❝ This is also the case for your calculations with theta0=0.9, but not so pronounced seen as with theta0=0.85. Check it by power calculations with n=120 for theta0=0.85 or theta0=0.9 and n=32. You will find the minimum (implying max. sample size) below CV=30% in both cases.


❝ Confused by this part. :confused:


What I tried to say here with my Swahili: Your first picture / calculations with T/R ratio 0.9, which you have considered as ok, also has the effects inherent you wondered about with T/R ratio 0.85 but to a lesser not so obvious degree if you look at the sample size.

Count up: post 996

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2016-01-26 17:31
(2983 d 16:03 ago)

@ Shuanghe
Posting: # 15856
Views: 16,702
 

 maximum sample size at which CV?

Dear Shuanghe,

adding a few lines of code to what Detlew wrote.

library(PowerTOST)
GMR <- seq(0.82, 0.95, 0.005)
CV  <- seq(0.25, 0.35, 0.005)
n   <- matrix(nrow=length(CV), ncol=length(GMR), byrow=TRUE,
              dimnames=list(CV, GMR))
pwr <- n
for (j in seq_along(CV)) {
  for (k in seq_along(GMR)) {
    x <- sampleN.RSABE(CV=CV[j], theta0=GMR[k],
                       design="2x2x4", print=FALSE,
                       details=FALSE)
    if (is.na(x[["Sample size"]])) { # 2nd try if necessary
      x <- sampleN.RSABE(CV=CV[j], theta0=GMR[k],
                         design="2x2x4", print=FALSE,
                         details=FALSE, nstart=x[["nlast"]])
    }
    n[j, k]   <- x[["Sample size"]]
    pwr[j, k] <- x[["Achieved power"]]
  }
}
print(n)
print(pwr)
max.n   <- apply(n, 2, max)     # maximum n for each GMR
min.pwr <- vector()             # explore min. power
for (k in seq_along(GMR)) {
  x <- n[, k]
  y <- which(x == max.n[k]) # max. sample size(s)
  if (length(y) == 1) { # already there
    min.pwr[k] <- names(y)
  } else {              # pick the minimum
    min.pwr[k] <- names(which(pwr[y, k] == min(pwr[y, k])))
  }
}
min.pwr <- as.numeric(min.pwr)
shift   <- diff(range(GMR))*0.01
plot(GMR, min.pwr, type="p", ylim=range(CV),
  ylab="CV for maximum n", las=1)
abline(h=0.3, lty=3)
text(GMR-shift, min.pwr, labels=max.n,
  cex=0.9, srt=90, pos=1, offset=1.6)


The maximum sample size within each GMR-column shows this strange behavior due the FDA’s combination of the regulatory constant log(1.25)/0.25, the PE-restriction, and the discontinuity (since RSABE can only be applied if CVwR ≥0.30). In the n-matrix you find the same maximum sample sizes in some GMR-columns. As Detlew pointed out, you can look at the minimum power to decide which one to select.

[image]
Interesting shape!

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
nobody
nothing

2016-01-26 18:40
(2983 d 14:54 ago)

@ Helmut
Posting: # 15857
Views: 16,734
 

 maximum sample size at which CV?

❝ Interesting shape!


Again and again I ask myself why reg agencies in year 2016 are allowed to impose such "scientific guidelines" drawn out of the as.. ehhhm, clear blue sky without doing such exploratory scientific work as presented here. It is a shame, with all the money going around in this industry. And academia appears not to be interested in such profane things.

Kindest regards, nobody
d_labes
★★★

Berlin, Germany,
2016-01-27 09:41
(2982 d 23:53 ago)

@ Helmut
Posting: # 15859
Views: 16,229
 

 maximum sample size at which CV?

Code Masta!

❝ ...

❝ Interesting shape!


Strange! Although I must confess that I don't really understand what this story tells.
(Ubiquitous question from German language teachers: "Was will der Dichter uns damit sagen?", google translate: "What does the poet to tell us?")

Count up: post 997

Regards,

Detlew
nobody
nothing

2016-01-27 10:08
(2982 d 23:27 ago)

@ d_labes
Posting: # 15860
Views: 16,496
 

 maximum sample size at which CV?

To me this Fig. tells the story that for GMR < 0.92 frequently the max n is reached BELOW the cut-off of 30% for CV. With a somewhat strange distribution at the very low (not relevant?) end for GMR...

I would like to think about somefink like this FIRST, before enforcing such policies....

Kindest regards, nobody
d_labes
★★★

Berlin, Germany,
2016-01-27 10:31
(2982 d 23:04 ago)

@ nobody
Posting: # 15861
Views: 16,296
 

 OT: Stop - think -act

Dear nobody,

❝ I would like to think about somefink like this FIRST, before enforcing such policies....


Just to repeat an ancient rule (10 years ago!) of our Admin of this forum (see here):
STOPTHINKACT :thumb up:

Count up - post 998

Regards,

Detlew
Shuanghe
★★  

Spain,
2016-01-28 13:44
(2981 d 19:50 ago)

@ Helmut
Posting: # 15875
Views: 16,216
 

 maximum sample size at which CV?

Dear Helmut and Detlew,

❝ What I tried to say here with my Swahili: ......


❝ adding a few lines of code to what Detlew wrote.

❝ ......


Now I understand it. I also noticed similar effect when I was playing sample size for power of 90%, without the wonder code like Helmut's of course :ok:

Many thanks.

All the best,
Shuanghe
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2016-01-28 14:49
(2981 d 18:45 ago)

@ Shuanghe
Posting: # 15879
Views: 16,453
 

 target power 90%

Dear Shuanghe and Detlew,

❝ I also noticed similar effect when I was playing sample size for power of 90%, without the wonder code like Helmut's of course


Target power 90%:

[image]

@Detlew: In my code I had to arbitrarily increase nstart in the second attempt, i.e., to

x <- sampleN.RSABE(CV=CV[j], theta0=GMR[k], targetpower=0.9,
                   design="2x2x4", print=FALSE,
                   details=FALSE, nstart=x[["nlast"]]*1.5)

because for CV=0.305, theta0=0.82 nlast is 442. With nstart=nlast the algo stops again (n 644, power 0.89243). Currently in line 159 of the source-code imax is fixed with 100. What do you think about introducing imax as an argument like in sampleN.TOST()?

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
d_labes
★★★

Berlin, Germany,
2016-02-01 20:16
(2977 d 13:19 ago)

@ Helmut
Posting: # 15909
Views: 16,119
 

 PowerTOST update

Dear Helmut,

❝ @Detlew: In my code I had to arbitrarily increase nstart in the second attempt, i.e., to

x <- sampleN.RSABE(CV=CV[j], theta0=GMR[k], targetpower=0.9,

❝                    design="2x2x4", print=FALSE,
❝                    details=FALSE, nstart=x[["nlast"]]*1.5)

❝ because for CV=0.305, theta0=0.82 nlast is 442.

❝ With nstart=nlast the algo stops again (n 644, power 0.89243). Currently in line 159 of the source-code imax is fixed with 100. What do you think about introducing imax as an argument like in sampleN.TOST()?


your wish is my command.

Yes, I know that the starting values of the sample size search in such extreme settings as you are using here is not always good enough to come to a result. Introducing an argument imax makes for the functions sampleN.scABEL() or sampleN.RSABE() more sense than for sampleN.TOST() itself. For the latter the starting values are generally good enough to achieve the sample size within at max. 10 iterations or so. Usually a lower number is required.

The update will need some time. In the meantime I suggest to change your code to allow more then two tries to obtain a sample size from sampleN.scABEL() or sampleN.RSABE() if you need the functionality in the near future.
Sumefink like:
  ...
  x <- sampleN.RSABE(CV=CV[j], theta0=GMR[k],
                     design="2x2x4", print=FALSE,
                     details=FALSE)
  n <- x[["Sample size"]]]

  while (is.na(n){
    # 2nd try if necessary
    x <- sampleN.RSABE(CV=CV[j], theta0=GMR[k],
                       design="2x2x4", print=FALSE,
                       details=FALSE, nstart=x[["nlast"]])
    n <- x[["Sample size"]]]
  }

Maybe it would be a good idea to introduce additionally a counter in the while loop with reaching a maximum will break that loop.

Regards,

Detlew
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2016-02-01 22:49
(2977 d 10:45 ago)

@ d_labes
Posting: # 15910
Views: 15,917
 

 #1,000

[image]Dear Detlew,

❝ your wish is my command.


Don’t hurry. I’m grateful for your gift to the community, PowerTOST and your contributions to the forum in the last eight years.

Congratulations to your post #1,000! Only 116 to catch up with ElMaestro. :smoke: You are guilty for almost 50% of posts from Germany. Do you feel lonely?

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
d_labes
★★★

Berlin, Germany,
2016-02-02 22:17
(2976 d 11:17 ago)

@ Helmut
Posting: # 15920
Views: 15,910
 

 OT: post #1,000

Dear Helmut,

❝ ... I’m grateful for your gift to the community, PowerTOST and your contributions to the forum in the last eight years.


Thank you for the flowers.
But my contribution to the community would have been NIL if I hadn't discovered this forum back in the year 2008, if I recall it exactly. Thanks Admin of the BE/BA forum.

❝ ... Only 116 to catch up with ElMaestro. :smoke:


I will hunt our Ol'Captain until he will give up :-D. Allthough I must confess that it's signature(s) is(/are) unbeatable! His eloquent posts of course also. Thanks Anders "Mr. Birdsong".

❝ You are guilty for almost 50% of posts from Germany. Do you feel lonely?


The last statement is really more than true, although nobody is close on my heels :cool:.
But I would be really glad if more substantial contributors would discuss here in the forum, from which country ever. Thus that the Forum is not like the answer machine "Ask Sam".

In summary: Thanks to all contributors. Thanks to all critical reviewers of my posts or of my baby PowerTOST. Lets continue in this exchange of ideas or implementation details in whatever programming language ever. First of all in R, since it's free :love:.

I will try to stay tuned, although as pensioner (German pronounced reindeer) since start of the year 2016 I will never ever have spare time enough :-D.

Regards,

Detlew
ElMaestro
★★★

Denmark,
2016-02-03 17:32
(2975 d 16:03 ago)

@ Helmut
Posting: # 15924
Views: 15,687
 

 #1,000

Hi d_labes,

❝ Congratulations to your post #1,000! Only 116 to catch up with ElMaestro. :smoke: You are guilty for almost 50% of posts from Germany. Do you feel lonely?


I likewise applaud you for your frequent expert contributions which I have learned a lot from.

When I posted my post #1000 I received from Bebac in Vienna a golden watch and a 3-week trip to Fiji with my wife, our 7 kids, and my personal assistant (NLYW) in a 5* hotel. In addition Hötzi bribed some Viennese city officals to rename a street after me, that's the reason you can now stroll down ElMaestro-Gasse (formerly called Mariahilfer Strasse, but that was way too complicated to pronounce anyway).

I am looking forward to hearing how you are rewarded. Keep up the good work. :-)

Pass or fail!
ElMaestro
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2016-02-03 17:50
(2975 d 15:44 ago)

@ ElMaestro
Posting: # 15925
Views: 15,916
 

 #1,000

Hi ElMaestro,

❝ In addition Hötzi bribed some Viennese city officals to rename a street after me, that's the reason you can now stroll down ElMaestro-Gasse (formerly called Mariahilfer Strasse, but that was way too complicated to pronounce anyway).


Oh, didn’t know that I succeeded at the end. Will have a look. Google tells me that it would take me four minutes to go there.

Dif-tor heh smusma 🖖🏼 Довге життя Україна! [image]
Helmut Schütz
[image]

The quality of responses received is directly proportional to the quality of the question asked. 🚮
Science Quotes
d_labes
★★★

Berlin, Germany,
2016-02-05 16:50
(2973 d 16:45 ago)

@ ElMaestro
Posting: # 15934
Views: 15,612
 

 OT: #1,000

Dear Ol#Pirate!

❝ I am looking forward to hearing how you are rewarded. Keep up the good work. :-)


First: THX for your applause.

Second: The reward for the 1000 post was obviously only for the First reaching that goal.
As Michail Gorbatschow has said: "Wer zu spät kommt den bestraft das Leben" (Those who are late will be punished by life itself) :-D.

Regarding naming a street after you I could do better: I have gotten a whole city, now in Poland known as Łobez :cool:.

Regards,

Detlew
ElMaestro
★★★

Denmark,
2016-02-05 18:02
(2973 d 15:32 ago)

@ d_labes
Posting: # 15935
Views: 15,562
 

 OT: #1,000

Dear Detlew,

❝ Regarding naming a street after you I could do better: I have gotten a whole city, now in Poland known as Łobez :cool:.


Then how about this ?


Pass or fail!
ElMaestro
d_labes
★★★

Berlin, Germany,
2016-02-05 20:48
(2973 d 12:47 ago)

@ ElMaestro
Posting: # 15936
Views: 15,543
 

 OT: #1,000

Dear Mr. Birdsong!

Then how about this ?


Can you send me a large box of this delectable drink :party:. Or two?

Regards,

Detlew
ElMaestro
★★★

Denmark,
2016-02-06 16:45
(2972 d 16:49 ago)

@ d_labes
Posting: # 15938
Views: 15,592
 

 OT: #1,000

De Detlew,

❝ Can you send me a large box of this delectable drink :party:. Or two?


There's nothing I would rather do. You'd be properly acquainted with Danish culture. Nevertheless, due to EU and rules and bureacracy and sh!t it seems quite impossible. If I am invited to the Berlin area some time in 2016 (Informa, the annual Inhalation event?!) then I will see if I can arrange something.

It is good stuff, you have something to look forward to. Alternatively, you could start your big Mercedes and drive to Denmark and pick a few cases up at my address.
Beaches, fresh air, sun, ocean, NLYWs playing beach volley, HC Andersen fairytales, Lego, and good beer... There are so many reasons to go here. Also Die Olsenbande. Much revered in the former East Germany :-D:-D:-D

Pass or fail!
ElMaestro
nobody
nothing

2016-02-07 10:50
(2971 d 22:45 ago)

@ ElMaestro
Posting: # 15940
Views: 15,379
 

 OT: #1,000

... and drive to Denmark and pick a few cases up at my address...

Reminder: Don't forget your ID-card and beware of the harsh looking border police. Welcome to Europe 2016...:no::crying:

Kindest regards, nobody
UA Flag
Activity
 Admin contact
22,957 posts in 4,819 threads, 1,640 registered users;
50 visitors (0 registered, 50 guests [including 2 identified bots]).
Forum time: 09:35 CET (Europe/Vienna)

Nothing shows a lack of mathematical education more
than an overly precise calculation.    Carl Friedrich Gauß

The Bioequivalence and Bioavailability Forum is hosted by
BEBAC Ing. Helmut Schütz
HTML5