Correct one-sided trialDesignGroupSequential object
Source:R/correct_one_sided_gsd.R
correct_one_sided_gsd.RdCurrently in rpact::getDesignGroupSequential(), when the test is one-sided,
there is no way to specify the direction of the null and alternative
hypotheses. This is an
open issue in rpact.. This
correction is only necessary for using rpact and impart together or when
exporting the correct boundaries from a one-sided
trialDesignGroupSequential object when the alternative is less than the
null value.
Value
A trialDesignGroupSequential object with the efficacy and futility
boundaries corrected and a logical scalar directionUpper indicating whether
the alternative is greater than the null value (TRUE) or less than the null
value (FALSE).
Examples
# One sided test: Higher values = Better
trial_design_one_sided_higher <-
rpact::getDesignGroupSequential(
alpha = 0.05,
beta = 1 - 0.80,
sided = 1,
informationRates = c(0.50, 0.75, 1),
typeOfDesign = "asOF",
typeBetaSpending = "bsOF",
bindingFutility = FALSE
)
# Bounds assumed are for $H_{A}: \theta > \theta_{0}$
trial_design_one_sided_higher$criticalValues
#> [1] 2.537988 2.015923 1.720132
trial_design_one_sided_higher$futilityBounds
#> [1] 0.4121106 1.1345811
# One sided test: Lower values = Better
trial_design_one_sided_lower <-
correct_one_sided_gsd(
trial_design = trial_design_one_sided_higher,
higher_better = FALSE
)
# Bounds for $H_{A}: \theta < \theta_{0}$
trial_design_one_sided_lower$criticalValues
#> [1] -2.537988 -2.015923 -1.720132
trial_design_one_sided_lower$futilityBounds
#> [1] -0.4121106 -1.1345811