getPowerCounts {rpact}  R Documentation 
Returns the power, stopping probabilities, and expected sample size for testing mean rates for negative binomial distributed event numbers in two samples at given sample sizes.
getPowerCounts(
design = NULL,
...,
directionUpper = NA,
maxNumberOfSubjects = NA_real_,
lambda1 = NA_real_,
lambda2 = NA_real_,
lambda = NA_real_,
theta = NA_real_,
thetaH0 = 1,
overdispersion = 0,
fixedExposureTime = NA_real_,
accrualTime = NA_real_,
accrualIntensity = NA_real_,
followUpTime = NA_real_,
allocationRatioPlanned = NA_real_
)
design 
The trial design. If no trial design is specified, a fixed sample size design is used.
In this case, Type I error rate 
... 
Ensures that all arguments (starting from the "...") are to be named and that a warning will be displayed if unknown arguments are passed. 
directionUpper 
Logical. Specifies the direction of the alternative,
only applicable for onesided testing; default is 
maxNumberOfSubjects 

lambda1 
A numeric value or vector that represents the assumed rate of a homogeneous Poisson process in the active treatment group, there is no default. 
lambda2 
A numeric value that represents the assumed rate of a homogeneous Poisson process in the control group, there is no default. 
lambda 
A numeric value or vector that represents the assumed rate of a homogeneous Poisson process in the pooled treatment groups, there is no default. 
theta 
A numeric value or vector that represents the assumed mean ratios lambda1/lambda2 of a homogeneous Poisson process, there is no default. 
thetaH0 
The null hypothesis value,
default is
For testing a rate in one sample, a value 
overdispersion 
A numeric value that represents the assumed overdispersion of the negative binomial distribution,
default is 
fixedExposureTime 
If specified, the fixed time of exposure per subject for count data, there is no default. 
accrualTime 
If specified, the assumed accrual time interval(s) for the study, there is no default. 
accrualIntensity 
If specified, the assumed accrual intensities for the study, there is no default. 
followUpTime 
If specified, the assumed (additional) followup time for the study, there is no default.
The total study duration is 
allocationRatioPlanned 
The planned allocation ratio 
At given design the function calculates the power, stopping probabilities, and expected sample size
for testing the ratio of two mean rates of negative binomial distributed event numbers in two samples
at given maximum sample size and effect.
The power calculation is performed either for a fixed exposure time or a variable exposure time with fixed followup
where the information over the stages is calculated according to the specified information rate in the design.
Additionally, an allocation ratio = n1 / n2
can be specified where n1
and n2
are the number
of subjects in the two treatment groups. A null hypothesis value thetaH0
can also be specified.
Returns a TrialDesignPlan
object.
The following generics (R generic functions) are available for this result object:
names()
to obtain the field names,
print()
to print the object,
summary()
to display a summary of the object,
plot()
to plot the object,
as.data.frame()
to coerce the object to a data.frame
,
as.matrix()
to coerce the object to a matrix
.
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
.
Other power functions:
getPowerMeans()
,
getPowerRates()
,
getPowerSurvival()
# Fixed sample size trial where a therapy is assumed to decrease the
# exacerbation rate from 1.4 to 1.05 (25% decrease) within an
# observation period of 1 year, i.e., each subject has a equal
# followup of 1 year.
# Calculate power at significance level 0.025 at given sample size = 180
# for a range of lambda1 values if the overdispersion is assumed to be
# equal to 0.5, is obtained by
getPowerCounts(alpha = 0.025, lambda1 = seq(1, 1.4, 0.05), lambda2 = 1.4,
maxNumberOfSubjects = 180, overdispersion = 0.5, fixedExposureTime = 1)
## Not run:
# Group sequential alpha and beta spending function design with O'Brien and
# Fleming type boundaries: Power and test characteristics for N = 286,
# under the assumption of a fixed exposure time, and for a range of
# lambda1 values:
getPowerCounts(design = getDesignGroupSequential(
kMax = 3, alpha = 0.025, beta = 0.2,
typeOfDesign = "asOF", typeBetaSpending = "bsOF"),
lambda1 = seq(0.17, 0.23, 0.01), lambda2 = 0.3,
directionUpper = FALSE, overdispersion = 1, maxNumberOfSubjects = 286,
fixedExposureTime = 12, accrualTime = 6)
# Group sequential design alpha spending function design with O'Brien and
# Fleming type boundaries: Power and test characteristics for N = 1976,
# under variable exposure time with uniform recruitment over 1.25 months,
# study time (accrual + followup) = 4 (lambda1, lambda2, and overdispersion
# as specified, no futility stopping):
getPowerCounts(design = getDesignGroupSequential(
kMax = 3, alpha = 0.025, beta = 0.2, typeOfDesign = "asOF"),
lambda1 = seq(0.08, 0.09, 0.0025), lambda2 = 0.125,
overdispersion = 5, directionUpper = FALSE, maxNumberOfSubjects = 1976,
followUpTime = 2.75, accrualTime = 1.25)
## End(Not run)