Shuanghe
★★  

Spain,
2016-03-07 19:04
(2942 d 20:21 ago)

Posting: # 16070
Views: 11,644
 

 PowerTOST sample size EMA full replicate [🇷 for BE/BA]

Hi All,

I was trying to produce sample size plots of full replicate BE for EMA regulation for my colleague, similar to those in this post, that would cover ISCV from 0.1 to 1, GMR from 0.9 to 1, using Helmut's code.

I noticed that at certain combinations PowerTOST would produce errors. e.g., with the following values
sampleN.scABEL(alpha = 0.05, targetpower = 0.8, theta0 = 0.91,
                    CV = 0.1, design = "2x2x4", regulator = "EMA")


would produce error
Error in if (pwr <= targetpower) cat(n, " ", formatC(pwr, digits = pd,  :
  missing value where TRUE/FALSE needed


These error only appear when CV is extremely low so in practice it doesn't matter since no one will use 2x2x4 replicate study for product with ISCV of 10%. I guess that's the reason I never noticed it before. So just for education purpose, can anyone tell me what's going on here? Maybe it's apparent for R gurus but as R novice I have no idea what the message says. According to Detlew, it's not a bug for sure. :-P


Edit: Category changed. [Helmut]

All the best,
Shuanghe
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2016-03-07 19:56
(2942 d 19:28 ago)

@ Shuanghe
Posting: # 16071
Views: 10,251
 

 merciless tester!

Hi Shuanghe,

❝ I noticed that at certain combinations PowerTOST would produce errors. e.g., with the following values

❝ sampleN.scABEL(alpha = 0.05, targetpower = 0.8, theta0 = 0.91,

❝                     CV = 0.1, design = "2x2x4", regulator = "EMA")

❝ would produce error

Error in if (pwr <= targetpower) cat(n, " ", formatC(pwr, digits = pd,  :

❝   missing value where TRUE/FALSE needed

Confirmed.

❝ These error only appear when CV is extremely low so in practice it doesn't matter since no one will use 2x2x4 replicate study for product with ISCV of 10%.


Right. :-D

❝ […] can anyone tell me what's going on here? Maybe it's apparent for R gurus but as R novice I have no idea what the message says.


At such a low CV you could use sampleN.TOST() to get a first idea:
library(PowerTOST)
x <- sampleN.TOST(targetpower = 0.8, theta0 = 0.91,
                  CV = 0.1, design = "2x2x4",
                  details = FALSE, print = FALSE)
cat(paste0("n = ", x[["Sample size"]], ", power = ",
           signif(x[["Achieved power"]], 6), "\n"))
n = 6, power = 0.913161


Looking at the source (type sampleN.scABEL in the console) we find
nmin <- 6
down <- FALSE

so I guess it could be possible. Needs some additional error-trapping. Detlew?

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
yjlee168
★★★
avatar
Homepage
Kaohsiung, Taiwan,
2016-03-07 21:15
(2942 d 18:10 ago)

@ Shuanghe
Posting: # 16072
Views: 10,223
 

 PowerTOST sample size EMA full replicate

Hi Shuanghe,

❝ would produce error

Error in if (pwr <= targetpower) cat(n, " ", formatC(pwr, digits = pd,  :

❝   missing value where TRUE/FALSE needed

The error messages implied that pwr is not a number at all. Maybe it is due to failing to compute. The other parameter targetpower has been given by user (which is 0.8 in your code). So it should not be the cause of the error. But we still need to wait for Detlew's response.

All the best,
-- Yung-jin Lee
bear v2.9.1:- created by Hsin-ya Lee & Yung-jin Lee
Kaohsiung, Taiwan https://www.pkpd168.com/bear
Download link (updated) -> here
d_labes
★★★

Berlin, Germany,
2016-03-08 09:50
(2942 d 05:35 ago)

(edited by d_labes on 2016-03-08 10:23)
@ Shuanghe
Posting: # 16074
Views: 10,026
 

 Merciless peer reviewers

Hi All,

❝ I noticed that at certain combinations PowerTOST would produce errors. e.g., with the following values

sampleN.scABEL(alpha = 0.05, targetpower = 0.8, theta0 = 0.91,

❝                     CV = 0.1, design = "2x2x4", regulator = "EMA")


❝ would produce error

Error in if (pwr <= targetpower) cat(n, " ", formatC(pwr, digits = pd,  :

❝   missing value where TRUE/FALSE needed

Confirmed. My suggestion: Contact the maintainer of that ugly R package and throw the code back in his face :-D.

All jokes aside: Thank you all for bug hunting. The reason identified was a too low starting value n0=2 which leaves no degrees of freedom for the CI. Exactly what Helmut suspected.
Will be corrected in the next version, coming soon. I promise :cool:.

BTW: All other scaled ABE sample size functions also suffer from the same potential bug :-(. Shit.

Regards,

Detlew
d_labes
★★★

Berlin, Germany,
2016-03-09 19:43
(2940 d 19:42 ago)

@ Shuanghe
Posting: # 16081
Views: 9,941
 

 PowerTOST V1.3-4

Dear Shuanghe, dear All!

Bug correction is on the way via CRAN. Should be available next days :cool:.

Regards,

Detlew
Astea
★★  

Russia,
2016-03-24 20:34
(2925 d 18:51 ago)

@ Shuanghe
Posting: # 16135
Views: 9,464
 

 PowerTOST sample size EMA full replicate

Dear all!
I've noted that sample size, estimated with the help of PowerTOST's scABEL, depends on the difference between CV_T and CV_R.
Suppose we have a HVD with unknown CV (or CV is known in literature but it ranges widely through the studies). There could be a situation when CV_T and CV_R do not coincides. For example, CV_R=0.3 and CV_T=0.4. Then basing on the sampleN.scABEL for theta0=0.9 we need 48 subjects. But if we plan replicate study on the basis of CV=0.3 we get only 34 subjects. Moreover planing replicate study without scaling (sampleN.TOST) we get only 40 subjects. Here I post the graph for illustration purposes (scABEL2 denotes sampleN.scABEL(CV=c(CV_T, 0.3), theta0=0.9, design="2x2x4"))
Do I undestand correctly? If it so then there are always exist a miserable possibility that calculated by scABEL with CV_T=CV_R sample size would be insufficient?

[image]


"Being in minority, even a minority of one, did not make you mad"
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2016-03-25 15:23
(2925 d 00:02 ago)

@ Astea
Posting: # 16139
Views: 9,513
 

 RSABE is not bijective (lengthy answer)

Hi Astea,

❝ I've noted that sample size, estimated with the help of PowerTOST's scABEL, depends on the difference between CV_T and CV_R.


Correct.

❝ Suppose we have a HVD with unknown CV (or CV is known in literature but it ranges widely through the studies). There could be a situation when CV_T and CV_R do not coincides.


Correct as well.

❝ Do I undestand correctly? If it so then there are always exist a miserable possibility that calculated by scABEL with CV_T=CV_R sample size would be insufficient?


Yes. Shit might happen.
  • CVwT < CVwR: Test “better” in terms of the variability; incentive in the sample size.

    library(PowerTOST)
    sampleN.scABEL(CV=c(0.3, 0.4), design="2x2x4",
                   details=F, print=F)[["Sample size"]]
    [1] 24


  • CVwT = CVwR: Test’s variability equals the one of the Reference.

    sampleN.scABEL(CV=rep(0.3, 2), design="2x2x4",
                   details=F, print=F)[["Sample size"]]
    [1] 34


  • CVwT > CVwR: Test “worse” in terms of the variability; penalty in the sample size.

    sampleN.scABEL(CV=c(0.4, 0.3), design="2x2x4",
                   details=F, print=F)[["Sample size"]]
    [1] 48
Let’s go back to conventional (unscaled) ABE in a 2×2×2 crossover. In this design we have no means to estimate the intrasubject CV separately for Test and Reference (CVwT, CVwR). We get only CVintra pooled from both. If CVwT < CVwR (in many cases…) the higher variability of R will lead to a wider CI (compared to the one with CVwT = CVwR) and the “good” T is penalized by the “bad” R.
Note that ABE is bijective (more about that later):

If T = R → R = T ∧ if T ≠ R → R ≠ T.


The original idea of reference-scaling goes back to a proposal by Boddy et al.1 for the 2×2×2 design and at a workshop2 dedicated to HVD(P)s two recommendations were given, namely

For some highly variable drugs and drug products, the bioequivalence standard should be modified by changing the bioequivalence limits while maintaining the current confidence interval at 90%
and
the bioequivalence limits should be determined based in part upon the intrasubject variability for the reference product.

(my emphases)
These suggestions lead to the reference-scaling model:

ln(0.80) / σw0 ≤ [ln(μT) – ln(μR)] / σwR ≤ ln(1.25) / σw0

where the switching variability σw0 is a fixed constant (specific for the agency).
Note that RSABE is not bijective like ABE. There is nothing like “test-scaled” ABE. Only if σwT ≡ σwR, you could switch from to [ln(μT) – ln(μR)] to [ln(μR) – ln(μT)] and get the same outcome. Statistically dissatisfying but it still makes sense: Only the Reference product has a documented history of safety and efficacy (phase III/IV).

Seen and Grieve3 argued that is not reasonable to assume heterogenicity in bioequivalence:

Why would an investigator plan a trial with the object of proving equality of two formulations if the variances were believed different?

I’m not so sure. Sometimes the originator is well aware that changing the manufacturing process would require a very expensive BE-study (even by applying RSABE; see this post for an example) and prefers to keep the manufacturing line “alive” as long as possible (“If it ain't broke, don't fix it”). Generic companies for ages are facing the problem to manufacture a product which is “equally bad” as the reference. Generally they don’t have last century’s machinery. Remember some PPIs (omeprazole, pantoprazole, lansoprazole)? The enteric coating of the originators’ products was lousy; some ABE-studies with extreme sample sized passed only by luck (subjects after R with very low concentrations and erratic profiles → extremely high CVintra → inflated CI), many studies failed, some companies simply gave up.

Coming back to your question:
  • If you have good reasons (pilot study!) to assume that CVwT < CVwR, perfect.
  • If you have no idea, I would assume that the CVs are equal.
  • If you believe (!) that your product will be worse than the Reference in terms of variability, you should add more subjects to be on the safe side since scaling is based on CVwR but the 90% CI still on the (pooled) CVintra.
Whenever you assume a CVwR keep the (maybe counterintuitive) behavior of power in ABEL in mind. Try this goody:

library(PowerTOST)
pa.scABE(CV=0.3, design="2x2x4")



  1. Boddy AW, Snikeris FC, Kringle RO, Wei GCG, Opperman JA, Midha KK. An Approach for Widening the Bioequivalence Acceptance Limits in the Case of Highly Variable Drugs. Pharm Res. 1995;12(12):1865–8. doi:10.1023/A:1016219317744
  2. Shah VP, Yacobi A, Barr WH, Benet LZ, Breimer D, Dobrinska MR, Endrényi L, Fairweather W, Gillespie W, Gonzalez MA, Hooper J, Jackson A, Lesko LJ, Midha KK, Noonan PK, Patnaik R, Williams RL. Evaluation of Orally Administered Highly Variable Drugs and Drug Formulations. Pharm Res. 1996;13(11):1590–4. doi:10.1023/A:1016468018478
  3. Senn S, Grieve AP. A Comment on Optimal Allocations for Bioequivalence Studies. Biometrics. 1999;55(4):1314–5. doi:10.1111/j.0006-341X.1999.01314.x

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
Astea
★★  

Russia,
2016-03-27 23:07
(2922 d 17:18 ago)

@ Helmut
Posting: # 16144
Views: 9,026
 

 RSABE is not bijective (lengthy answer)

Dear Helmut!

I am very grateful for your detailed answer!

❝ Whenever you assume a CVwR keep the (maybe counterintuitive) behavior of power in ABEL in mind.


Are there some general sound advices how to plan the study with SCABE?

As an example, on the basis of literature data CV of some drug ranges from 32 % to 46 %. If we plan sample size basing on the highest value we would get the less number! What should we prefer? :confused:

"Being in minority, even a minority of one, did not make you mad"
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2016-03-28 02:42
(2922 d 13:42 ago)

@ Astea
Posting: # 16147
Views: 9,348
 

 ABEL sample size examples

Hi Astea,

❝ I am very grateful for your detailed answer!


And I’m grateful for interesting questions! (see my signature)

❝ ❝ Whenever you assume a CVwR keep the (maybe counterintuitive) behavior of power in ABEL in mind.


❝ Are there some general sound advices how to plan the study with SCABE?


By counterintuitive I meant power curves for different CVs (while keeping the the T/R-ratio and sample size constant) in ABEL. In ABE it is straightforward: Higher CV → wider CI → lower power → increase the sample size to keep power. Hence, if you want to be on the safe side, assume a higher CV (or the upper CL of an estimated CV). I will explore your example for ABEL below.

❝ As an example, on the basis of literature data CV of some drug ranges from 32 % to 46 %. If we plan sample size basing on the highest value we would get the less number!


Let’s assume CV 32%, T/R 0.9, target power 80%, 4-period full replicate for the EMA’s ABEL:

[image]


If the CV decreases, power increases. That’s similar to ABE. But if the CV increases, power increases as well because the acceptance range will be wider and a smaller sample size would be sufficient (yes, you are right!). This increase ends at 50% because the scaling ends here. Any higher CV will decrease power again. Starting here, ABEL – apart from the additional PE-restriction – behaves like ABE.

Now let’s assume CV 46%:

[image]


With lower CVs we will loose power for the given sample size. Whether such a loss is acceptable is another story (at 32%: 73.5%).

❝ What should we prefer? :confused:


I would say for any CV the rule for ABE given above reverses: If you want to be on the safe side, assume a lower CV (or the lower CL of an estimated CV). If you have good reasons that the CV will not drop much below 50%, use the ABE-rule again.

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
mittyri
★★  

Russia,
2016-03-28 23:54
(2921 d 16:31 ago)

@ Helmut
Posting: # 16149
Views: 11,220
 

 ABEL sample size: more power! (joke)

Hi Helmut and Astea,

"Dear volunteers of the sequence 2 (TRTR), please take some grapefruit juice before dosing on period 4" :-D

[image]

Assumptions:
Power: at least 90%
Alpha: 0.025%
CVWR: as low as possible
CVWT: as much as possible
GMR: no better than 90%

And you don't have any profit from ABEL! :lol2:

Kind regards,
Mittyri
UA Flag
Activity
 Admin contact
22,957 posts in 4,819 threads, 1,638 registered users;
69 visitors (0 registered, 69 guests [including 10 identified bots]).
Forum time: 15:25 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