View source: R/f_simulation_base_count_data.R
getSimulationCounts | R Documentation |
Returns the simulated power, stopping probabilities, conditional power, and expected sample size for testing mean rates for negative binomial distributed event numbers in the two treatment groups testing situation.
getSimulationCounts(
design = NULL,
...,
plannedCalendarTime,
maxNumberOfSubjects = NA_real_,
lambda1 = NA_real_,
lambda2 = NA_real_,
lambda = NA_real_,
theta = NA_real_,
directionUpper = NA,
thetaH0 = 1,
overdispersion = 0,
fixedExposureTime = NA_real_,
accrualTime = NA_real_,
accrualIntensity = NA_real_,
followUpTime = NA_real_,
allocationRatioPlanned = NA_real_,
maxNumberOfIterations = 1000L,
seed = NA_real_,
showStatistics = FALSE
)
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. |
plannedCalendarTime |
For simulating count data, the time points where an analysis is planned to be performed.
Should be a vector of length |
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. |
directionUpper |
Logical. Specifies the direction of the alternative,
only applicable for one-sided testing; default is |
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) follow-up time for the study, there is no default.
The total study duration is |
allocationRatioPlanned |
The planned allocation ratio |
maxNumberOfIterations |
The number of simulation iterations, default is |
seed |
The seed to reproduce the simulation, default is a random seed. |
showStatistics |
Logical. If |
At given design the function simulates the power, stopping probabilities, conditional power, and expected
sample size at given number of subjects and parameter configuration.
Additionally, an allocation ratio = n1/n2
and a null hypothesis value thetaH0
can be specified.
Returns a SimulationResults
object.
The following generics (R generic functions) are available for this 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
.
The summary statistics "Simulated data" contains the following parameters: median range; mean +/-sd
$show(showStatistics = FALSE)
or $setShowStatistics(FALSE)
can be used to disable
the output of the aggregated simulated data.
getData()
can be used to get the aggregated simulated data from the
object as data.frame
. The data frame contains the following columns:
iterationNumber
: The number of the simulation iteration.
stageNumber
: The stage.
lambda1
: The assumed or derived event rate in the treatment group.
lambda2
: The assumed or derived event rate in the control group.
accrualTime
: The assumed accrualTime.
followUpTime
: The assumed followUpTime.
overdispersion
: The assumed overdispersion.
fixedFollowUp
: The assumed fixedFollowUp.
numberOfSubjects
: The number of subjects under consideration when the (interim) analysis takes place.
rejectPerStage
: 1 if null hypothesis can be rejected, 0 otherwise.
futilityPerStage
: 1 if study should be stopped for futility, 0 otherwise.
testStatistic
: The test statistic that is used for the test decision
estimatedLambda1
: The estimated rate in treatment group 1.
estimatedLambda2
: The estimated rate in treatment group 2.
estimatedOverdispersion
: The estimated overdispersion.
infoAnalysis
: The Fisher information at interim stage.
trialStop
: TRUE
if study should be stopped for efficacy or futility or final stage, FALSE
otherwise.
conditionalPowerAchieved
: Not yet available
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
.
## Not run:
# Fixed sample size design with two groups, fixed exposure time
getSimulationCounts(
theta = 1.8,
lambda2 = 0.2,
maxNumberOfSubjects = 200,
plannedCalendarTime = 8,
maxNumberOfIterations = 1000,
fixedExposureTime = 6,
accrualTime = 3,
overdispersion = 2)
# Group sequential design alpha spending function design with O'Brien and
# Fleming type boundaries: Power and test characteristics for N = 264,
# under variable exposure time with uniform recruitment over 1.25 months,
# study time (accrual + followup) = 4, interim analysis take place after
# equidistant time points (lambda1, lambda2, and overdispersion as specified,
# no futility stopping):
dOF <- getDesignGroupSequential(
kMax = 3,
alpha = 0.025,
beta = 0.2,
typeOfDesign = "asOF")
getSimulationCounts(design = dOF,
lambda1 = seq(0.04, 0.12, 0.02),
lambda2 = 0.12,
directionUpper = FALSE,
overdispersion = 5,
plannedCalendarTime = (1:3)/3*4,
maxNumberOfSubjects = 264,
followUpTime = 2.75,
accrualTime = 1.25,
maxNumberOfIterations = 1000)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.