PowerTOST [Power / Sample Size]

posted by Helmut Homepage – Vienna, Austria, 2022-05-04 12:33 (716 d 20:16 ago) – Posting: # 22959
Views: 2,121

Hi pharm07,

❝ response in R console : > utils:::menuInstallLocal()

package ‘PowerTOST’ successfully unpacked and MD5 sums checked


OK, so you ended up as shown there (example for Power2Stage).

❝ Even after this step i am not able to attach power tost to the library.


Package library. Not sure what you mean, can you explain?

❝ After this step i can able to do further.


OK.

❝ Please suggest.


Copy one of the examples of my previous post and paste it to the [image] console. If you want to go for the FDA’s method, just a one-liner because theta0 = 0.975, design = "2x2x4", and targetpower = 0.8 are defaults of the function. Hence, you have to specify only the CV:

sampleN.NTID(CV = 0.1)

Should give:

+++++++++++ FDA method for NTIDs ++++++++++++
           Sample size estimation
---------------------------------------------
Study design:  2x2x4 (TRTR|RTRT)
log-transformed data (multiplicative model)
1e+05 studies for each step simulated.

alpha  = 0.05, target power = 0.8
CVw(T) = 0.1, CVw(R) = 0.1
True ratio     = 0.975
ABE limits     = 0.8 ... 1.25
Implied scABEL = 0.9002 ... 1.1108
Regulatory settings: FDA
- Regulatory const. = 1.053605
- 'CVcap'           = 0.2142

Sample size search
 n     power
14   0.717480
16   0.788690
18   0.841790


Since this is a four-period design, you may want to increase the sample size to compensate for a potential loss in power due to dropouts.

balance <- function(n, n.seq) {
  # Round up to obtain balanced sequences
  return(as.integer(n.seq * (n %/% n.seq + as.logical(n %% n.seq))))
}
nadj <- function(n, do.rate, n.seq) {
  # Round up to compensate for anticipated dropout-rate
  return(as.integer(balance(n / (1 - do.rate), n.seq)))
}
CV      <- 0.1                 # Assumed CV
do.rate <- 0.15                # Anticipated dropout-rate 15%
n       <- sampleN.NTID(CV = CV, print = FALSE, details = FALSE)[["Sample size"]]
dosed   <- nadj(n, do.rate, 2) # Adjust the sample size
df      <- data.frame(dosed = dosed, eligible = dosed:(n - 2))
for (j in 1:nrow(df)) {
  df$dropouts[j] <- sprintf("%.1f%%", 100 * (1 - df$eligible[j] / df$dosed[j]))
  df$power[j]    <- suppressMessages( # We know that some are unbalanced
                      power.NTID(CV = CV, n = df$eligible[j]))
}
print(df, row.names = FALSE)

 dosed eligible dropouts   power
    22       22     0.0% 0.91017
    22       21     4.5% 0.89602
    22       20     9.1% 0.88031
    22       19    13.6% 0.86072
    22       18    18.2% 0.84179
    22       17    22.7% 0.81658
    22       16    27.3% 0.78869


If you are confused, see 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

Complete thread:

UA Flag
Activity
 Admin contact
22,988 posts in 4,825 threads, 1,654 registered users;
87 visitors (0 registered, 87 guests [including 3 identified bots]).
Forum time: 08:50 CEST (Europe/Vienna)

The whole purpose of education is
to turn mirrors into windows.    Sydney J. Harris

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