Skip to content

Commit

Permalink
Merge pull request #66 from rpact-com/dev/4.1.1
Browse files Browse the repository at this point in the history
Enhancement #65 and other improvements
  • Loading branch information
fpahlke authored Nov 20, 2024
2 parents d0eecb9 + 24c9a98 commit ae013d3
Show file tree
Hide file tree
Showing 53 changed files with 958 additions and 709 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: rpact
Title: Confirmatory Adaptive Clinical Trial Design and Analysis
Version: 4.1.0.9268
Date: 2024-11-07
Version: 4.1.0.9271
Date: 2024-11-20
Authors@R: c(
person(
given = "Gernot",
Expand Down Expand Up @@ -103,6 +103,7 @@ Collate:
'f_analysis_base_means.R'
'f_analysis_base_rates.R'
'f_analysis_base_survival.R'
'f_analysis_boundary_recalculation.R'
'f_analysis_enrichment.R'
'f_analysis_enrichment_means.R'
'f_analysis_enrichment_rates.R'
Expand Down
7 changes: 7 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@

## Improvements, issues, and changes

* The full set of unit tests for rpact is now stored in a private repository.
Only members of the 'RPACT User Group' have access to the tests.
For more information, please visit: [rpact.org/iq](www.rpact.org/iq)
* Usage of `maxInformation` improved (see enhancement [#65](https://github.com/rpact-com/rpact/issues/65))
* `testPackage()`: additional warning details will be added to the test report if warnings exist
* Issue [#61](https://github.com/rpact-com/rpact/issues/61)) fixed
* Flexibility of function `getPiecewiseSurvivalTime()` improved
* Test coverage improved
* Minor improvements


Expand Down
9 changes: 6 additions & 3 deletions R/class_core_parameter_set.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
## |
## | Contact us for information about our services: info@rpact.com
## |
## | File version: $Revision: 8274 $
## | Last changed: $Date: 2024-09-26 11:33:59 +0200 (Do, 26 Sep 2024) $
## | File version: $Revision: 8416 $
## | Last changed: $Date: 2024-11-18 16:13:44 +0100 (Mo, 18 Nov 2024) $
## | Last changed by: $Author: pahlke $
## |

Expand Down Expand Up @@ -285,6 +285,9 @@ ParameterSet <- R6::R6Class("ParameterSet",
isUndefinedParameter = function(parameterName) {
return(self$.getParameterType(parameterName) == C_PARAM_TYPE_UNKNOWN)
},
isNotApplicableParameter = function(parameterName) {
return(self$.getParameterType(parameterName) == C_PARAM_NOT_APPLICABLE)
},
.getInputParameters = function() {
params <- self$.getParametersOfOneGroup(c(C_PARAM_USER_DEFINED, C_PARAM_DEFAULT_VALUE))
return(params)
Expand Down Expand Up @@ -1323,7 +1326,7 @@ ParameterSet <- R6::R6Class("ParameterSet",
parametersToIgnore <- intersect(parametersToIgnore, parameterNames)
}

if (parameterSet$.getParameterType("hazardRatio") == C_PARAM_GENERATED &&
if (parameterSet$isGeneratedParameter("hazardRatio") &&
!is.null(parameterSet[[".piecewiseSurvivalTime"]]) &&
isTRUE(parameterSet$.piecewiseSurvivalTime$piecewiseSurvivalEnabled)) {
parametersToIgnore <- c(parametersToIgnore, "hazardRatio")
Expand Down
33 changes: 24 additions & 9 deletions R/class_design.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
## |
## | Contact us for information about our services: info@rpact.com
## |
## | File version: $Revision: 8180 $
## | Last changed: $Date: 2024-09-06 10:13:14 +0200 (Fr, 06 Sep 2024) $
## | File version: $Revision: 8416 $
## | Last changed: $Date: 2024-11-18 16:13:44 +0100 (Mo, 18 Nov 2024) $
## | Last changed by: $Author: pahlke $
## |

Expand Down Expand Up @@ -736,7 +736,7 @@ TrialDesignInverseNormal <- R6::R6Class("TrialDesignInverseNormal",
informationRatesTemp, self$informationRates
))
}
if (self$.getParameterType("futilityBounds") != C_PARAM_GENERATED &&
if (!self$isGeneratedParameter("futilityBounds") &&
(!grepl("^as.*", typeOfDesign) || typeBetaSpending == C_TYPE_OF_DESIGN_BS_NONE) &&
!identical(futilityBoundsTemp, self$futilityBounds)) {
return(self$.pasteComparisonResult(
Expand Down Expand Up @@ -953,10 +953,14 @@ TrialDesignConditionalDunnett <- R6::R6Class("TrialDesignConditionalDunnett",
informationAtInterim = NULL,
secondStageConditioning = NULL,
sided = NULL,
initialize = function(..., informationAtInterim = NULL, secondStageConditioning = NULL) {
initialize = function(...,
informationAtInterim = NULL,
secondStageConditioning = NULL,
directionUpper = NA) {
super$initialize(...)
self$informationAtInterim <- informationAtInterim
self$secondStageConditioning <- secondStageConditioning
self$directionUpper <- directionUpper
notApplicableParameters <- c(
"kMax",
"stages",
Expand Down Expand Up @@ -1009,6 +1013,8 @@ TrialDesignConditionalDunnett <- R6::R6Class("TrialDesignConditionalDunnett",
#' If \code{secondStageConditioning = FALSE} is specified, the unconditional adjusted p-values are used, otherwise
#' conditional adjusted p-values are calculated, default is \code{secondStageConditioning = TRUE}
#' (for details, see Koenig et al., 2008).
#' @inheritParams param_directionUpper
#' @inheritParams param_three_dots
#'
#' @details
#' For performing the conditional Dunnett test the design must be defined through this function.
Expand All @@ -1025,16 +1031,25 @@ TrialDesignConditionalDunnett <- R6::R6Class("TrialDesignConditionalDunnett",
#'
#' @export
#'
getDesignConditionalDunnett <- function(alpha = 0.025, # C_ALPHA_DEFAULT
informationAtInterim = 0.5, secondStageConditioning = TRUE) {
getDesignConditionalDunnett <- function(
alpha = 0.025, # C_ALPHA_DEFAULT
informationAtInterim = 0.5,
...,
secondStageConditioning = TRUE,
directionUpper = NA) {
.assertIsValidAlpha(alpha)
.assertIsSingleNumber(informationAtInterim, "informationAtInterim")
.assertIsInOpenInterval(informationAtInterim, "informationAtInterim", 0, 1)
return(TrialDesignConditionalDunnett$new(
.assertIsSingleLogical(directionUpper, "directionUpper", naAllowed = TRUE)
design <- TrialDesignConditionalDunnett$new(
alpha = alpha,
informationAtInterim = informationAtInterim,
secondStageConditioning = secondStageConditioning
))
secondStageConditioning = secondStageConditioning,
directionUpper = directionUpper
)
design$.setParameterType("directionUpper", ifelse(!is.na(directionUpper),
C_PARAM_USER_DEFINED, C_PARAM_NOT_APPLICABLE))
return(design)
}

#'
Expand Down
Loading

0 comments on commit ae013d3

Please sign in to comment.