Skip to contents

Returns the power and average sample number of the specified design.

Usage

getPowerAndAverageSampleNumber(design, theta = seq(-1, 1, 0.02), nMax = 100)

Arguments

design

The trial design.

theta

A vector of standardized effect sizes (theta values), default is a sequence from -1 to 1.

nMax

The maximum sample size. Must be a positive integer of length 1.

Value

Returns a PowerAndAverageSampleNumberResult object. The following generics (R generic functions) are available for this result object:

Details

This function returns the power and average sample number (ASN) of the specified design for the prototype case which is testing H0: mu = mu0 in a one-sample design. theta represents the standardized effect (mu - mu0) / sigma and power and ASN is calculated for maximum sample size nMax. For other designs than the one-sample test of a mean the standardized effect needs to be adjusted accordingly.

How to get help for generic functions

Click on the link of a generic in the list above to go directly to the help documentation of the rpact specific implementation of the generic. Note that you can use the R function methods to get all the methods of a generic and to identify the object specific name of it, e.g., use methods("plot") to get all the methods for the plot generic. There you can find, e.g., plot.AnalysisResults and obtain the specific help documentation linked above by typing ?plot.AnalysisResults.

Examples

# Calculate power, stopping probabilities, and expected sample 
# size for the default design with specified theta and nMax  
getPowerAndAverageSampleNumber(
    getDesignGroupSequential(), 
    theta = seq(-1, 1, 0.5), nMax = 100)
#> Power and average sample size (ASN):
#> 
#> User defined parameters:
#>   Effect                         : -1.0, -0.5, 0.0, 0.5, 1.0 
#> 
#> Default parameters:
#>   N_max                          : 100.0000 
#> 
#> Output:
#>   Average sample sizes (ASN)     : 100.000, 100.000, 99.753, 59.070, 33.689 
#>   Power                          : 0.0000, 0.0000, 0.0250, 0.9987, 1.0000 
#>   Early stop                     : 0.00000, 0.00000, 0.00716, 0.94840, 1.00000 
#>   Early stop [1]                 : 0.0000000, 0.0000000, 0.0002592, 0.2794958, 0.9893440 
#>   Early stop [2]                 : 0.0000000, 0.0000000, 0.0069009, 0.6689035, 0.0106560 
#>   Early stop [3]                 : NA, NA, NA, NA, NA 
#>   Overall reject                 : 0.0000, 0.0000, 0.0250, 0.9987, 1.0000 
#>   Reject per stage [1]           : 0.0000000, 0.0000000, 0.0002592, 0.2794958, 0.9893440 
#>   Reject per stage [2]           : 0.0000000, 0.0000000, 0.0069009, 0.6689035, 0.0106560 
#>   Reject per stage [3]           : 0.0000000, 0.0000000, 0.0178399, 0.0502917, 0.0000000 
#>   Overall futility               : 0.0000, 0.0000, 0.0000, 0.0000, 0.0000 
#>   Futility stop per stage [1]    : 0.0000, 0.0000, 0.0000, 0.0000, 0.0000 
#>   Futility stop per stage [2]    : 0.0000, 0.0000, 0.0000, 0.0000, 0.0000 
#> 
#> Legend:
#>   [k]: values at stage k
#>