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

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/expSampleSize_noninf.R

Description

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

Usage

1
2
3
4
expsampleN.noninf(alpha = 0.025, targetpower = 0.8, logscale = TRUE, 
                  theta0, margin, CV, design = "2x2", robust = FALSE, 
                  prior.type = c("CV", "theta0", "both"), prior.parm = list(),
                  method = c("exact", "approx"), print = TRUE, details)

Arguments

alpha

Significance level (one-sided). Defaults here to 0.025.

targetpower

Power to achieve at least. Must be >0 and <1. Typical values are 0.8 or 0.9.

logscale

Should the data used on log-transformed or on original scale? TRUE or FALSE.
Defaults to TRUE.

theta0

Assumed ‘true’ (or ‘observed’ in case of prior.type != "CV") ratio or difference.
In case of logscale=TRUE it must be given as ratio T/R.
If logscale=FALSE, the difference in means. In this case, the difference may be expressed in two ways: relative to the same (underlying) reference mean, i.e. as (T-R)/R = T/R - 1; or as difference in means T-R. Note that in the former case the units of margin and CV need also be given relative to the reference mean (specified as ratio).
Defaults to 0.95 if logscale=TRUE or to -0.05 if logscale=FALSE

margin

Non-inferiority margin.
In case of logscale=TRUE it is given as ratio.
If logscale=FALSE, the limit may be expressed in two ways: difference of means relative to the same (underlying) reference mean or in units of the difference of means. Note that in the former case the units of CV and theta0 need also be given relative to the reference mean (specified as ratio).
Defaults to 0.8 if logscale=TRUE or to -0.2 if logscale=FALSE.

CV

In case of logscale=TRUE the (geometric) coefficient of variation given as ratio.
If logscale=FALSE the argument refers to (residual) standard deviation of the response. In this case, standard deviation may be expressed two ways: relative to a reference mean (specified as ratio sigma/muR), i.e. again as a coefficient of variation; or untransformed, i.e. as standard deviation of the response. Note that in the former case the units of theta0, theta1 and theta2 need also be given relative to the reference mean (specified as ratio).

If prior.type="CV" may be given as vector: The CVs are then pooled (as a weighted mean with their degrees of freedoms as weights).

In case of cross-over studies this is the within-subject CV, in case of a parallel-group design the CV of the total variability.

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.
Setting 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 known.designs() for designs covered in this package.

prior.type

Specifies which parameter uncertainty should be accounted for. In case of prior.type="CV" (the default), only the uncertainty with respect to the CV will be considered (i.e., the given treatment effect is assumed to be fix). In case of prior.type="theta0" only uncertainty with respect to the treatment ratio/difference will be accounted for (i.e., the given CV is assumed to be fix). In case of prior.type="both" the power value will be unconditional with respect to both the CV and theta0.

prior.parm

A list of parameters expressing the prior information about the variability and/or treatment effect. Possible components are df, SEM, m, design.
For prior.type="CV" the degrees of freedom from the prior trial are required. This information can be provided by specifying the single componentdf or the combination consisting of m and design.
For prior.type = "theta0" the standard error of the treatment difference from the prior trial is required. This information can be provided by specifying the single component SEM or the combination consisting of m and design.
For prior.type = "both" the degrees of freedom and the standard error of the treatment difference are required. This information can be provided by specifying the combination consisting of df and SEM or via the combination m and design.
See section ‘Details’ for a technical description of each component.

method

Defaults to method="exact". In that case the expected power will be calculated as expected value of the power with respect to the (prior) distribution of the respective parameter(s).
Set to method="approx" the expected power according to the approximate formulas given by Julious or Julious & Owen will be calculated (using the non-central t); this only affects prior.type = "CV".

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.
If not specified, the default value is FALSE for prior.type != "both" and TRUE otherwise.

Details

The sample size is estimated based on iterative evaluation of expected power. The starting value of the sample size search is taken from a large sample approximation if prior.type="CV". Else an empirical start value is obtained. Note that in case of prior.type="both" the calculation may still take several seconds.

Note also that the expected power is always bounded above by the so-called probability of technical success (PTS) which may be a value less than 1.Therefore, it may be possible that it is either not possible to calculate the required sample size at all or that the sample size gets very large if the given targetpower is less but close to the PTS.

Notes on the underlying hypotheses
If the supplied margin is < 0 (logscale=FALSE) or < 1 (logscale=TRUE), then it is assumed higher response values are better. The hypotheses are
H0: theta0 <= margin
H1: theta0 > margin
where theta0 = mean(test)-mean(reference) if logscale=FALSE
or
H0: log(theta0) <= log(margin)
H1: log(theta0) > log(margin)
where theta0 = mean(test)/mean(reference) if logscale=TRUE.

If the supplied margin is > 0 (logscale=FALSE) or > 1 (logscale=TRUE), then it is assumed lower response values are better. The hypotheses are
H0: theta0 >= margin
H1: theta0 < margin
where theta0 = mean(test)-mean(reference) if logscale=FALSE
or
H0: log(theta0) >= log(margin)
H1: log(theta0) < log(margin)
where theta0 = mean(test)/mean(reference) if logscale=TRUE.
This latter case may also be considered as ‘non-superiority’.

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 designs implemented.

Author(s)

B. Lang, D. Labes

References

Grieve AP. Confidence Intervals and Sample Sizes. Biometrics. 1991;47:1597–603. doi: 10.2307/2532411

O’Hagan, Stevens, JW, Campell MJ. Assurance in Clinical Trial Design. Pharm Stat. 2005;4:187–201. doi: 10.1002/pst.175

Julious SA, Owen RJ. Sample size calculations for clinical studies allowing for uncertainty in variance. Pharm Stat. 2006;5:29–37. doi: 10.1002/pst.197

Julious SA. Sample sizes for Clinical Trials. Boca Raton: CRC Press; 2010.

Bertsche A, Nehmitz G, Beyersmann J, Grieve AP. The predictive distribution of the residual variability in the linear-fixed effects model for clinical cross-over trials. Biom J. 2016;58(4):797–809. doi: 10.1002/bimj.201500245

Box GEP, Tiao GC. Bayesian Inference in Statistical Analysis. Boston: Addison-Wesley; 1992.

Held L, Sabanes Bove D. Applied Statistical Inference. Likelihood and Bayes. Berlin, Heidelberg: Springer; 2014. doi: 10.1007/978-3-642-37887-4

Senn S. Cross-over Trials in Clinical Research. Chichester: John Wiley & Sons; 2nd edition 2002.

Zierhut ML, Bycott P, Gibbs MA, Smith BP, Vicini P. Ignorance is not bliss: Statistical power is not probability of trial success. Clin Pharmacol Ther. 2015;99:356–9. doi: 10.1002/cpt.257

See Also

exppower.noninf, known.designs, sampleN.noninf

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# Classical 2x2 cross-over, target power = 80%,
# assumed true ratio = 95%, margin = 0.8,
# intra-subject CV=30% estimated from prior 2x2 trial 
# with m = 12 subjects
expsampleN.noninf(theta0 = 0.95, margin = 0.8, CV = 0.3, design = "2x2",
                  prior.parm = list(m = 12, design = "2x2"))
# gives n = 58 with achieved expected power 0.809148 
# Compare this to the usual sample size with CV assumed
# as 'carved in stone'
sampleN.noninf(theta0 = 0.95, margin = 0.8, CV = 0.3)

# Perform 'non-superiority' (lower is better) with assumed
# true ratio = 105% and margin 125%
expsampleN.noninf(theta0 = 1.05, margin = 1.25, CV = 0.3, design = "2x2",
                  prior.parm = list(m = 12, design = "2x2"))
# should give n = 56 with achieved expected power 0.806862

# More than one CV with corresponding degrees of freedom 
# other settings as above in first example
CVs <- c(0.25, 0.3)
dfs <- c(22, 10)
expsampleN.noninf(theta0 = 0.95, margin = 0.8, CV = CVs, 
                  prior.parm = list(df = dfs))
# should give a pooled CV=0.2664927 with 32 df and a sample
# size n=42 with achieved expected power 0.814073 exact
# achieved expected power 0.816163 approximate acc. to Julious

# Uncertainty is accounted for CV and theta0

expsampleN.noninf(CV = 0.3, prior.type = "both",
                  prior.parm = list(m = 12, design = "2x2"))
# gives a dramatic increase in sample size (n = 194)
# due to small pilot trial

Example output

++++++++++++++ Non-inferiority test ++++++++++++++
       Sample size est. with uncertain CV
--------------------------------------------------
Study design:  2x2 crossover 
log-transformed data (multiplicative model)

alpha = 0.025, target power = 0.8
Non-inf. margin = 0.8 
Ratio = 0.95
CV = 0.3 with 10 df

Sample size (ntotal)
 n   exp. power
58   0.809148 


++++++++++++ Non-inferiority test +++++++++++++
            Sample size estimation
-----------------------------------------------
Study design:  2x2 crossover 
log-transformed data (multiplicative model)

alpha = 0.025, target power = 0.8
Non-inf. margin = 0.8
True ratio = 0.95,  CV = 0.3

Sample size (total)
 n     power
48   0.801658 

++++++++++++++ Non-inferiority test ++++++++++++++
       Sample size est. with uncertain CV
--------------------------------------------------
Study design:  2x2 crossover 
log-transformed data (multiplicative model)

alpha = 0.025, target power = 0.8
Non-inf. margin = 1.25 
Ratio = 1.05
CV = 0.3 with 10 df

Sample size (ntotal)
 n   exp. power
56   0.806862 


++++++++++++++ Non-inferiority test ++++++++++++++
       Sample size est. with uncertain CV
--------------------------------------------------
Study design:  2x2 crossover 
log-transformed data (multiplicative model)

alpha = 0.025, target power = 0.8
Non-inf. margin = 0.8 
Ratio = 0.95
CV(pooled) = 0.2664927 with 32 df

Sample size (ntotal)
 n   exp. power
42   0.814073 


++++++++++++++ Non-inferiority test ++++++++++++++
  Sample size est. with uncertain CV and theta0
--------------------------------------------------
Study design:  2x2 crossover 
log-transformed data (multiplicative model)

Design characteristics:
df = n-2, design const. = 2, step = 2

alpha = 0.025, target power = 0.8
Non-inf. margin = 0.8 
Ratio = 0.95 with 10 df
CV = 0.3 with 10 df

Upper bound of expected power = 0.908941

Sample size search (ntotal)
 n   exp. power
202   0.803044 
198   0.801659 
194   0.800247 
186   0.797210 
190   0.798741 
192   0.799490 

6 iterations
194   0.800247 

Exact expected power calculation.

PowerTOST documentation built on Jan. 18, 2021, 5:07 p.m.