Compliance
★    

India,
2013-07-23 16:09
(3927 d 12:47 ago)

Posting: # 11038
Views: 10,069
 

 Sample size calculation by power-tost software [Software]

Dear All,

can any one tell us how to calculate sample size by using power-tost software. we had tried a lot but unable to understand how to use this software.

Regards,

Compliance


Edit: Category changed. [Helmut]
d_labes
★★★

Berlin, Germany,
2013-07-23 18:23
(3927 d 10:32 ago)

@ Compliance
Posting: # 11039
Views: 9,155
 

 Sample size estimation with PowerTOST

Dear Compliance,

❝ can any one tell us how to calculate sample size by using power-tost software. we had tried a lot but unable to understand how to use this software.


That's a very broad and unspecific question. Could you please be more elaborate?

Did you read the manual?
Had you had a look at the examples in it?

As a little primer:
Need to estimate the (classical) sample size for a 2x2 crossover. Assumed CV (from previous studies, from pilot study or from literature) is 30% (0.3 as ratio). Assumed distribution is log-normal.
Just type in the R-console:
sampleN.TOST(CV=0.3)
Hit the ENTER key.
That is it, because most of the arguments of the function have reasonable default values. Again, RTFM!

Response after hitting ENTER (printing all the default settings):
+++++++++++ Equivalence test - TOST +++++++++++
            Sample size estimation
-----------------------------------------------
Study design:  2x2 crossover
log-transformed data (multiplicative model)

alpha = 0.05, target power = 0.8
BE margins        = 0.8 ... 1.25
Null (true) ratio = 0.95,  CV = 0.3

Sample size (total)
 n     power
40   0.815845


BTW: I strongly recommend you Helmut's lectures, especially those dealing with sample size estimation. They have at many places hints how it could be done with PowerTOST.

Hope this helps.

Regards,

Detlew
Ben
★    

2013-07-28 15:08
(3922 d 13:47 ago)

(edited by Ben on 2013-07-28 16:06)
@ d_labes
Posting: # 11085
Views: 9,040
 

 PowerTOST Usage

Dear Detlew,

I tried to send a direct messag via Helmuts forum form, but I suspect that it has not worked properly. So, I will give it another try in here as I have two specific questions related to the usage of the R package PowerTOST (which somehow fits to this post I guess) and it would be great if you could shed some light on that.
First, every time I want to use the helper functions CV2se and se2CV I am confused why it is called that way, and not „CV2sd“ and „sd2CV“, respectively. Standard error always reminds me of sd/sqrt(n) or sd*sqrt(2/n) which is not what we want to plug in here...?!
My second question refers to the option „logscale=FALSE“. When logscale=FALSE then I wonder how the argument CV looks like. CV is actually sd/mean, but then one also requires to know something about the mean. A better argument would be the standard deviation and a look into your code reveals that in fact you directly put CV <- se. But when looking into the manual, there is no reference that it will be handled this way and moreover, in the example from sampleN.TOST you write „total CV=20%“ when putting CV=0.2 as an argument. Shouldn‘t it then be „total SD = 0.2“ (not in percent)?

Thank you,
Ben
d_labes
★★★

Berlin, Germany,
2013-07-28 20:00
(3922 d 08:55 ago)

@ Ben
Posting: # 11086
Views: 9,070
 

 PowerTOST naming issues

Dear Ben,

❝ First, every time I want to use the helper functions CV2se and se2CV I am confused why it is called that way, and not „CV2sd“ and „sd2CV“, respectively. Standard error always reminds me of sd/sqrt(n) or sd*sqrt(2/n) which is not what we want to plug in here...?!


Ok, maybe that your naming proposal fits your needs better. Mine was driven from the term standard deviation of error (=square root of the error variance).
What you link with this symbol is usually written as SEM = standard error of mean by me (and many others).

❝ My second question refers to the option „logscale=FALSE“. When logscale=FALSE then I wonder how the argument CV looks like. CV is actually sd/mean, but then one also requires to know something about the mean. A better argument would be the standard deviation and a look into your code reveals that in fact you directly put CV <- se. But when looking into the manual, there is no reference that it will be handled this way and moreover, in the example from sampleN.TOST you write „total CV=20%“ when putting CV=0.2 as an argument. Shouldn‘t it then be „total SD = 0.2“ (not in percent)?


You may use the mean and standard deviation the way you describe, I think. Try it by yourself.
You may also use the mean ratio (theat0) as deviation from 1 and then the CV is the ratio sd/mean. The last was the way Kem Philips has described in his basic paper, the ancestor of all power/samplesize papers on the field of BE studies. I have this adopted in my description in the manual

I must confess that I hadn't thought too much about the description in the manual if you use „logscale=FALSE“. This was only implemented for reasons of completeness for comparison with historically tables from that times as it was custom to evaluate BE studies with both log-transformed and untransformed data. But nowadays only log-transformed evaluations are done.

If you prefer untransformed evaluations (f.i. for PD parameters) the use of the Fieller CI is IMHO the appropriate method. Thus use then sampleN.RatioF() for sample size estimations.
Using sampleN.TOST() with logscale=FALSE is only an approximation since it neglects the fact that the Reference mean is only obtained as an estimate.

Naming the input parameter other than CV would inflate the parameter list which is long enough already now, I think. And it would raise the programming burden for me which was already big enough (at east for me as an bloody dabbler).

If this all don't fit your needs: The open source idea is, amongst other, take my code and do it better than I was able to do.


BTW: There is the possibility to write to the maintainer of the PowerTOST package directly. The CRAN policy deemed him to publish his mail address for that purpose :cool:.
Having the side effect of getting some more spam than already usual. :vomit:

Regards,

Detlew
ElMaestro
★★★

Denmark,
2013-07-28 21:06
(3922 d 07:50 ago)

@ d_labes
Posting: # 11087
Views: 9,010
 

 PowerTOST Usage

Dear Detleffff,

❝ Ok, maybe that your naming proposal fits your need better. Mine was driven from the term standard deviation of error.


No sir :-D With all due respect, I side with Ben here. I think you should follow common naming conventions.
I am not often using PowerTOST but I think that what you are calling 'standard deviation of error' is no such thing. It is a measure of the standard deviation of the mean difference (on the log scale, for the most common use) and as such it could be termed sd or s, but definitely not Standard Error.
In practice we nned to regard the SD as a variability measure, whereas the SE is a measure of how well we have estimated the mean (slash mean difference). The two are related but different.

Pass or fail!
ElMaestro
d_labes
★★★

Berlin, Germany,
2013-07-28 21:30
(3922 d 07:26 ago)

@ ElMaestro
Posting: # 11088
Views: 9,038
 

 Common naming conventions of EM

Hi Anders,

❝ No sir :-D With all due respect, I side with Ben here. I think you should follow common naming conventions.


Do you remember functions EatMyShorts <- function (x, V, T, W) or
Apfelstrudel<-function(t, df, ta, tb, ncp) not to speak about I_Eat_Cadmium <- function(P, TR, CV, alpha, N) :-D.

For the rest see my proposal for Ben: Take my code and do it better.

Regards,

Detlew
ElMaestro
★★★

Denmark,
2013-07-28 21:40
(3922 d 07:15 ago)

@ d_labes
Posting: # 11089
Views: 8,971
 

 Common naming conventions of EM

Dear Detleff,

❝ Do you remember functions EatMyShorts <- function (x, V, T, W) or

Apfelstrudel<-function(t, df, ta, tb, ncp) not to speak about I_Eat_Cadmium <- function(P, TR, CV, alpha, N) :-D.


I was young and wreckless back then. Now I have matured into an entirely different beast - bloody intelligent and handsome.

This discussion is making me hungry. Got some spare batteries I could have?

Pass or fail!
ElMaestro
Ben
★    

2013-07-29 19:04
(3921 d 09:52 ago)

@ d_labes
Posting: # 11116
Views: 8,950
 

 PowerTOST naming issues

Dear Detlew,

Don't get me wrong, I am a big fan of PowerTOST which I could not do better! I was just curious about the background of the notation and whether I misunderstand something here. Especially regarding when to use logscale=FALSE and what it actually means. Thank you for clarifying this!

Best regards,
Ben
Helmut
★★★
avatar
Homepage
Vienna, Austria,
2013-07-23 18:27
(3927 d 10:28 ago)

@ Compliance
Posting: # 11040
Views: 9,435
 

 Error description?

Hi Compliance,

❝ can any one tell us how to calculate sample size by using power-tost software.


Sure.

❝ we had tried a lot but unable to understand how to use this software.


That’s not what I call an exhaustive description of the problem. What did you try? What did not work?

Start the R-console and attach the library by typing library(PowerTOST). Type help(package=PowerTOST). The help-index opens in your preferred browser and shows a list of available functions.
Try sampleN.TOST. If you are just interested in sample size estimation, type simply ?sampleN.TOST).
On top below “Usage” you see all “arguments“ you may specify. Some are defaults; you can leave them out if your study is within the variables’ range.
Most simple case: You want to estimate* the sample size for a 2×2×2 cross-over, CV 20%, assumed T/R-ratio 95%, 80% power. Just type
sampleN.TOST(CV=0.2)
and you will get
+++++++++++ Equivalence test - TOST +++++++++++
            Sample size estimation
-----------------------------------------------
Study design:  2x2 crossover
log-transformed data (multiplicative model)

alpha = 0.05, target power = 0.8
BE margins        = 0.8 ... 1.25
Null (true) ratio = 0.95,  CV = 0.2

Sample size (total)
 n     power
20   0.834680

Note that everything in PowerTOST is given in fractions – not percentages.

If the output is too verbose for your taste, switch it off to get a data.frame:
sampleN.TOST(CV=0.2, print=F, details=F)
  Design alpha  CV theta0 theta1 theta2 Sample size Achieved power Target power
1    2x2  0.05 0.2   0.95    0.8   1.25          20      0.8346802          0.8


Power 90% instead of 80%:
sampleN.TOST(CV=0.2, targetpower=0.9, print=F, details=F)
  Design alpha  CV theta0 theta1 theta2 Sample size Achieved power Target power
1    2x2  0.05 0.2   0.95    0.8   1.25          26      0.9176333          0.9


Worse ratio:
sampleN.TOST(CV=0.2, targetpower=0.9, theta0=0.9, print=F, details=F)
  Design alpha  CV theta0 theta1 theta2 Sample size Achieved power Target power
1    2x2  0.05 0.2    0.9    0.8   1.25          50      0.9008663          0.9


Long half-life drug and/or study in patients? Note that the CV is CVtotal and not CVintra. Likely to be higher. 80% power is all we can afford:
sampleN.TOST(CV=0.5, targetpower=0.8, theta0=0.9, design="parallel", print=F, details=F)
    Design alpha  CV theta0 theta1 theta2 Sample size Achieved power Target power
1 parallel  0.05 0.5    0.9    0.8   1.25         400      0.8007482          0.8


Sample size in the 2×2×2 above (50) larger than the clinical capacity? Try a 4-period full replicate design (TRTR|RTRT):
sampleN.TOST(CV=0.2, targetpower=0.9, theta0=0.9, design="2x2x4", print=F, details=F)
  Design alpha  CV theta0 theta1 theta2 Sample size Achieved power Target power
1  2x2x4  0.05 0.2    0.9    0.8   1.25          26      0.9130555          0.9


Four periods lead to unacceptable high sampling volumes or you are concerned about dropouts? Try a 3-period full replicate (TRT|RTR):
sampleN.TOST(CV=0.2, targetpower=0.9, theta0=0.9, design="2x2x3", print=F, details=F)
  Design alpha  CV theta0 theta1 theta2 Sample size Achieved power Target power
1  2x2x3  0.05 0.2    0.9    0.8   1.25          38      0.9066936          0.9


… or a partial replicate (TRR|RTR|RRT):
sampleN.TOST(CV=0.2, targetpower=0.9, theta0=0.9, design="2x3x3", print=F, details=F)
  Design alpha  CV theta0 theta1 theta2 Sample size Achieved power Target power
1  2x3x3  0.05 0.2    0.9    0.8   1.25          39      0.9131147          0.9


OK, the study is for EMA and we are allowed to widen the acceptance range for Cmax only. CV with 50% is higher than the one of AUC. If we run the study in 26 subjects, how much power can we expect?
power.scABEL(CV=0.5, theta0=0.9, design="2x2x4", n=26)
[1] 0.78733



  • Avoid the word ‘calculate’. The input are either estimates themselves (CVs, ratios of previous studies) or assumptions (the expected ratio of the next study). You can only estimate something from un­cer­tain input. It’s not like 2 × 2 = 4.

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

India,
2013-07-29 07:46
(3921 d 21:09 ago)

@ Helmut
Posting: # 11090
Views: 8,915
 

 Error description?

Dear All,

Thank you for the help and educating me.

Regards
UA Flag
Activity
 Admin contact
22,993 posts in 4,828 threads, 1,657 registered users;
63 visitors (0 registered, 63 guests [including 8 identified bots]).
Forum time: 04:56 CEST (Europe/Vienna)

So far as I can remember,
there is not one word in the Gospels
in praise of intelligence.    Bertrand Russell

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