Learn R Programming

PowerTOST (version 1.3-5)

expsampleN.noninf: Sample size based on 'expected' power for the non-inferiority test

Description

Calculates the sample size based on 'expected' power for a variety of study designs used in bioequivalence studies. See known.designs() for the study designs covered.

Usage

expsampleN.noninf(alpha = 0.025, targetpower = 0.8, logscale=TRUE,
                  theta0, margin, CV, dfCV, design = "2x2", robust=FALSE, 
                  method=c("exact", "approx"), print = TRUE, details = FALSE, 
                  imax=100)

Arguments

alpha
Error probability. Typically set to 0.025 for one-sided test.
targetpower
Power to achieve at least. Must be >0 and
logscale
Should the data used on log-transformed or on original scale? TRUE or FALSE. Defaults to TRUE.
theta0
'True' or assumed bioequivalence ratio or difference. Maybe missing. Defaults then to 0.95 if logscale=TRUE or to -0.05 if logscale=FALSE.
margin
Non-inferiority margin. In case of logscale=TRUE it must be given as ratio, otherwise as diff. Defaults to 0.8 if logscale=TRUE or to -0.2 if logscale=FALSE.
CV
Coefficient of variation as ratio. May be given as vector. Then the CV's were pooled as weighted mean (of s2) with their df (degrees of freedom) as weights.
dfCV
Degrees of freedom for the CV's. Must be a vector of same length as CV. dfCV=Inf is allowed but makes only sense if CV/dfCV are scalars.
design
Character string describing the study design. See known.designs() for designs covered in this package.
robust
Defaults to FALSE. With that value the usual degrees of freedom will be used. Set to TRUE will use the degrees of freedom according to the 'robust' evaluation (aka Senn's basic estimator). These df are calculated as n-seq. See <
method
Defaults to code{method="exact"}. In that case the expected power will be calculated as expected value of the power with respect to the (prior) distribution of sigma^2 (inverse gamma distribution). Set to method="approx" will calculate the
print
If TRUE (default) the function prints its results. If FALSE only a data.frame with the results will be returned.
details
If TRUE the design characteristics and the steps during sample size calculations will be shown. Defaults to FALSE.
imax
Maximum number of steps in sample size search. Defaults to 100. Adaption only in very rare cases needed. Never seen a need for adaption up to now.

Value

  • A data.frame with the input values and the result of the sample size estimation. The "Sample size" column contains the total sample size in case of all design implemented.

Details

The sample size is calculated based on iterative evaluation of 'expected' power exact as expected value of the power with respect to the (prior) distribution of sigma^2 (inverse gamma distribution) or via Julious formulas based on non-central t-distribution. The start value of the sample size search is taken from a large sample approximation. The sample size is bound to 4 as minimum.

References

A.P. Grieve "Confidence Intervals and Sample Sizes" Biometrics 47, 1597-1603 December 1991 O'Hagan et al. "Assurance in Clinical Trial Design" Pharmaceut. Statist. 2005; 4: 187-201 S.A. Julious "Sample sizes for Clinical Trials" CRC Press, Chapman & Hall, Boca Raton 2010

See Also

exppower.noninf, sampleN.noninf

Examples

Run this code
# Classical 2x2 cross-over, target power = 80\%, alpha=0.025
# logscale=TRUE, 'non-superiority' margin 125\%, assumed true BE ratio = 105\%,
# intra-subject CV=30\% estimated with 10 df
# using all the other defaults
expsampleN.noninf(theta0=1.05, margin=1.25, CV=0.3, dfCV=10)
# -> gives n=56 with achieved expected power 0.0.806862
# Compare this to the usual sample size with CV known as 'carved in stone'
sampleN.noninf(theta0=1.05, margin=1.25, CV=0.3)

# More then one CV with corresponding degrees of freedom 
# other parameters as above
CVs <- c(0.25, 0.3)
dfs <- c(  22, 10)
expsampleN.noninf(theta0=1.05, margin=1.25, CV=CVs, dfCV=dfs)
# -> gives a pooled CV=0.2664927 with df=32
# and a sample size n=40 with achieved expected power 0.806073 exact
# sample size n=40 with achieved expected power 0.808157 acc. to Julious/Owen

Run the code above in your browser using DataLab