dshah
★★  

India/United Kingdom,
2020-10-16 08:20
(1250 d 03:00 ago)

Posting: # 22011
Views: 3,702
 

 Sample size for NTI using FDA method by excel macro [Power / Sample Size]

Dear All!
Hope you all are doing fine.
I would like to know about any available excel tool for sample size calculation for NTI by FDA method.
I am asking this as many times- tools like R, Gpower etc. requires installation of software which is not permissible by many firms/organization.
Regards,
Dshah
d_labes
★★★

Berlin, Germany,
2020-10-16 13:09
(1249 d 22:12 ago)

@ dshah
Posting: # 22013
Views: 3,348
 

 Sample size for NTI using FDA method by excel macro

Dear dshah!

❝ I would like to know about any available excel tool for sample size calculation for NTI by FDA method.


Sorry but to my knowledge there is no excel tool for sample size calculation for NTI by FDA method.
And I'm quite sure that such a tool is never available.
The FDA method for NTID's is a framework. You have to rely on simulations to do power calculations / sample size estimation. It is hard to imagine that this may be done within excel :no:.

❝ I am asking this as many times- tools like R, Gpower etc. requires installation of software which is not permissible by many firms/organization.


Shit happens :crying:.
Try to convince your boss / IT department that you absolutely need R and the package PowerTOST to do your job. At least if it comes to sample size estimation.

Regards,

Detlew
dshah
★★  

India/United Kingdom,
2020-10-16 14:11
(1249 d 21:10 ago)

@ d_labes
Posting: # 22015
Views: 3,272
 

 Sample size for NTI using FDA method by excel macro

Dear d_labes!
Thank you for your suggestion and I will try to convenience my IT.
Regards,
Dshah
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2020-10-16 13:11
(1249 d 22:10 ago)

@ dshah
Posting: # 22014
Views: 3,336
 

 Simulating studies in Excel not possible

Hi dshah,

❝ I would like to know about any available excel tool for sample size calculation for NTI by FDA method.

❝ I am asking this as many times- tools like R, Gpower etc. requires installation of software which is not permissible by many firms/organization.


Sorry, you have to convince your paranoic IT department.
The [image] package PowerTOST is used in many companies and by regulatory agencies as well. The FDA’s Donald Schuir­mann performed his simulations in S-Plus, [image] (‼), and APL.*

Background: For all reference-scaled approaches (the EMA’s ABEL, the FDA’s RSABE and NTID) you have to simulate studies. To get a stable result 100,000 are required. Even if you manage it to simulate subjects in Excel (a nutjob’s work but in principle doable), you will hit even in the current version of Excel the maximum number of rows (220 = 1,048,576). In other words, you can’t simulate more than 10 subjects…


  • Schuirmann DJ. Evaluation of Scaling Approaches to Demonstrate BE of NTI Drugs – OGD Simulation Efforts. Advisory Committee for Pharmaceutical Science and Clinical Pharmacology. 26 July, 2011. [image] Archive-It (p.57–100 of the PDF).

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

India/United Kingdom,
2020-10-16 14:12
(1249 d 21:09 ago)

@ Helmut
Posting: # 22016
Views: 3,286
 

 Simulating studies in Excel not possible

Dear Helmut!

Thank you so much for your suggestion. I will try to convenience my IT for R package.

Regards,
Dshah
martin
★★  

Austria,
2020-10-16 14:52
(1249 d 20:28 ago)

@ dshah
Posting: # 22017
Views: 3,291
 

 Simulating studies in Excel not possible

dear dshah,

you find this presentation helpful for discussion with your IT Friends Don’t Let Friends Use Excel for Statistics where I like the picture on slide 4 very much

hope this helps

martin
dshah
★★  

India/United Kingdom,
2020-10-20 08:59
(1246 d 02:22 ago)

@ martin
Posting: # 22034
Views: 2,956
 

 Simulating studies in Excel not possible

Dear Martin!

❝ you find this presentation helpful for discussion with your IT Friends Don’t Let Friends Use Excel for Statistics where I like the picture on slide 4 very much


Thank you and even I like Slide 4 ;-)

Regards,
Dshah
yjlee168
★★★
avatar
Homepage
Kaohsiung, Taiwan,
2020-10-17 10:09
(1249 d 01:11 ago)

(edited by yjlee168 on 2020-10-17 14:12)
@ Helmut
Posting: # 22019
Views: 3,217
 

 may be possible -> Simulating studies in Excel not possible

Hi Helmut,

❝ ...

❝ Sorry, you have to convince your paranoic IT department.


Agree definitely.

❝ ...

❝ Background: For all reference-scaled approaches (the EMA’s ABEL, the FDA’s RSABE and NTID) you have to simulate studies. To get a stable result 100,000 are required. Even if you manage it to simulate subjects in Excel (a nutjob’s work but in principle doable), you will hit even in the current version of Excel the maximum number of rows (220 = 1,048,576). In other words, you can’t simulate more than 10 subjects…


Not quite (my turn :-D). IMHO, simulation with MS-Excel does not require so many cells or number of rows. In MS-Excel or MS-Word, there is a macro language called VBA (Visual BASIC for Application) that is similar to any programming language. So you just save the final results when doing simulations. Therefore, I don't think you need so many cells to save each simulation, if I understand what you said correctly.

Ps. Here is a very nice slide file about MS-Excel simulations.

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
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2020-10-17 13:30
(1248 d 21:50 ago)

@ yjlee168
Posting: # 22020
Views: 3,250
 

 Simulating studies in Excel possible but slow?

Hi Yung-jin,

❝ […] In MS-Excel or MS-Word, there is a macro language called VBA (Visual Basic for Applications) that is similar to any programming language.


I know, used it ages ago myself though never for statistics. ;-)

❝ So you just save the final results when doing simulations. Therefore, I don't think you need so many cells save each simulation, if I understand what you said correctly.


Right.

❝ Ps. Here is a very nice slide file about MS-Excel simulations.


You need Excel 2010 or later which uses the Mersenne Twister. In earlier versions the period of the pseudo­random number generator was just 216 – 1 = 65,535.
However, I guess that simulations in VBA will be extremely slooow.
In [image] on my six years old machine (CVwR = CVwT, T/R-ratio 0.975, ≥80% power, 4-period full replicate design, 100,000 simulations):

library(PowerTOST)
system.time(
  cat("Sample size:", sampleN.NTIDFDA(CV = 0.1, print = FALSE,
                                      details = FALSE)[["Sample size"]],
      "\nRuntime (seconds):\n")
)

Sample size: 18
Runtime (seconds):
   user  system elapsed
   0.14    0.01    0.15


[image] Beat It.

For paranoiacs: Ever heard of macro viruses? I know of one company not allowing FARTSSIE
BTW, in v2.5 of last Tuesday Dave removed all reference-scaled methods and gives the code of PowerTOST in a box. ;-)

Edit 01 Jan 2022: Background and examples.

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,
2020-10-19 04:16
(1247 d 07:05 ago)

@ Helmut
Posting: # 22023
Views: 3,071
 

 Have you upgraded to R v4.0.3 yet?

Dear Helmut,

❝ However, I guess that simulations in VBA will be extremely slooow.


Perhaps. Maybe Dave can tell us more later. Well, it can be slow, but should not be that slooow.

❝ ...

Sample size: 18

❝ Runtime (seconds):

❝ user system elapsed

❝ 0.14 0.01 0.15


I run the codes three times under R v4.0.3 and got:

Sample size: 18
Runtime (seconds):
   user  system elapsed
   0.11    0.00    0.13

Sample size: 18
Runtime (seconds):
   user  system elapsed
   0.09    0.01    0.10

Sample size: 18
Runtime (seconds):
   user  system elapsed
   0.11    0.00    0.11


a little bit faster. :-D I guess that you have not upgraded to R 4.0.3 yet. R v4.0.3 is simply faster (still my gut feeling :-D). I remember that your Xeon computer runs faster than my Windows, even than my Linux notebook last time. Is it the same computer?

❝ For paranoiacs: Ever heard of macro viruses?


like Melissa? Yes, it's quite possible and should be very careful. But you know we cannot blame VBA. Bad guy is everywhere.

❝ I know of one company not allowing FARTSSIE…...


True. However, some time there is no need to talk to IT department to install R or anything else. Quite ironically.

❝ BTW, in v2.5 of last Tuesday Dave removed all reference-scaled methods and gives the code of PowerTOST in a box. ;-)


Thanks for the information.

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
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2020-10-19 14:12
(1246 d 21:09 ago)

@ yjlee168
Posting: # 22027
Views: 3,221
 

 Run on R v4.0.3

Hi Yung-jin,

❝ ❝ Sample size: 18

❝ ❝ Runtime (seconds):

❝ ❝ user system elapsed

❝ ❝ 0.14 0.01 0.15


❝ I run the codes three times under R v4.0.3 and got:


Runtime (seconds):

   user  system elapsed

   0.11    0.00    0.13

   0.09    0.01    0.10

   0.11    0.00    0.11


❝ a little bit faster. :-D I guess that you have not upgraded to R 4.0.3 yet.


Nope, was on 4.0.3 as well.

❝ R v4.0.3 is simply faster (still my gut feeling :-D).


Cannot check. Deleted 4.0.2 already and not in the mood to reinstall it.

❝ I remember that your Xeon computer runs faster than my Windows, even than my Linux notebook last time. Is it the same computer?


It is. However, median of 15 runs 0.16 seconds. No idea.

❝ ❝ BTW, in v2.5 of last Tuesday Dave removed all reference-scaled methods and gives the code of PowerTOST in a box. ;-)


❝ Thanks for the information.


Welcome.

Not for an initiate like you but for FARTSSIE-adepts…
With the script below you can reproduce the results of FARTSSIE ≤2.4; for the EMA’s ABEL you have to change cell U16 from 5 (which is for Health Canada’s TPD) to 3.

library(PowerTOST)
CV     <- seq(0.25, 0.65, 0.05)
theta0 <- 0.90
power  <- 0.80
design <- "2x2x4"
pers   <- as.numeric(substr(design, 5, 5))
n      <- data.frame(CV = CV)
theta1 <- numeric()
for (j in seq_along(CV)) {
  theta1[j] <- exp(-0.76*CV2se(CV[j]))
  if (CV[j] <= 0.3) theta1[j] <- 0.8
  if (CV[j] >= 0.5) theta1[j] <- exp(-0.76*CV2se(0.5))
  n.2x2x2       <- sampleN.TOST(CV = CV[j], design = "2x2x2",
                                targetpower = power, theta0 = theta0,
                                theta1 = theta1[j], theta2 = 1/theta1[j],
                                method = "nct", details = FALSE,
                                print = FALSE)[["Sample size"]]
  n$FARTSSIE[j] <- ceiling(n.2x2x2*(-0.25*pers+1.5))
  n$ABEL[j]     <- sampleN.scABEL(CV = CV[j], design = design,
                                  targetpower = power, theta0 = theta0,
                                  details = FALSE,
                                  print = FALSE)[["Sample size"]]
}
n$CV        <- n$CV*100
names(n)[1] <- "CV (%)"
cat("design:", design, "\n"); print(n, row.names = FALSE)

[image]design: 2x2x4
 CV (%) FARTSSIE ABEL
     25       28   28
     30       40   34
     35       32   34
     40       27   30
     45       25   28
     50       23   28
     55       27   30
     60       31   32
     65       35   36

[image]design: 2x2x3
 CV (%) FARTSSIE ABEL
     25       42   42
     30       60   50
     35       48   50
     40       41   46
     45       38   42
     50       35   42
     55       41   44
     60       47   48
     65       53   54


Flaws:
  • Direct expansion of the limits instead of simulations, restriction of the point estimate (within 80.00–125.00%) not taken into account.
  • Sample size estimated for 2×2×2 design and adapted (i.e., 50% for 4-period full replicates, 75% for three period replicates).
PS: Do you plan to implement my [image]-code for ABE of last May in a future release of bear?

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
UA Flag
Activity
 Admin contact
22,940 posts in 4,812 threads, 1,639 registered users;
42 visitors (0 registered, 42 guests [including 7 identified bots]).
Forum time: 10:21 CET (Europe/Vienna)

Those people who think they know everything
are a great annoyance to those of us who do.    Isaac Asimov

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