Skip to content

Commit

Permalink
675: Add DesignGrouped (#677)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
danielinteractive and github-actions[bot] authored Sep 16, 2023
1 parent a804814 commit 7c6ed0e
Show file tree
Hide file tree
Showing 27 changed files with 1,225 additions and 252 deletions.
1 change: 1 addition & 0 deletions .lintr
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
linters: linters_with_defaults(
line_length_linter = line_length_linter(120),
cyclocomp_linter = NULL,
indentation_linter = NULL,
object_usage_linter = NULL,
object_length_linter = NULL,
object_name_linter = object_name_linter(c("CamelCase", "camelCase", "snake_case"))
Expand Down
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Collate:
'checkmate.R'
'crmPack-package.R'
'helpers_covr.R'
'helpers_design.R'
'helpers_model.R'
'logger.R'
'utils-pipe.R'
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export(.DefaultCohortSizeParts)
export(.DefaultCohortSizeRange)
export(.DefaultDALogisticLogNormal)
export(.DefaultDataGrouped)
export(.DefaultDesignGrouped)
export(.DefaultDualEndpoint)
export(.DefaultDualEndpointBeta)
export(.DefaultDualEndpointEmax)
Expand Down Expand Up @@ -87,6 +88,7 @@ export(.DefaultStoppingTargetBiomarker)
export(.DefaultStoppingTargetProb)
export(.DefaultTITELogisticLogNormal)
export(.Design)
export(.DesignGrouped)
export(.DualDesign)
export(.DualEndpoint)
export(.DualEndpointBeta)
Expand Down Expand Up @@ -191,6 +193,7 @@ export(DataMixture)
export(DataOrdinal)
export(DataParts)
export(Design)
export(DesignGrouped)
export(DualDesign)
export(DualEndpoint)
export(DualEndpointBeta)
Expand Down Expand Up @@ -378,6 +381,7 @@ exportClasses(DataMixture)
exportClasses(DataOrdinal)
exportClasses(DataParts)
exportClasses(Design)
exportClasses(DesignGrouped)
exportClasses(DualDesign)
exportClasses(DualEndpoint)
exportClasses(DualEndpointBeta)
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Version 1.0.9000.9133
* Added new `DataGrouped` class to support simultaneous dose escalation with monotherapy and combination therapy.
* Added new `DataGrouped` and `DesignGrouped` classes with corresponding model `LogisticLogNormalGrouped` to support simultaneous dose escalation with monotherapy and combination therapy arms.
* Created the `CrmPackClass` class as the ultimate ancestor of all other
`crmPack` classes to allow identification of crmPack classes and simpler
definition of generic methods.
Expand Down
87 changes: 87 additions & 0 deletions R/Design-class.R
Original file line number Diff line number Diff line change
Expand Up @@ -529,3 +529,90 @@ DADesign <- function(model, data,
safetyWindow = safetyWindow
)
}

# DesignGrouped ----

## class ----

#' `DesignGrouped`
#'
#' @description `r lifecycle::badge("experimental")`
#'
#' [`DesignGrouped`] combines two [`Design`] objects: one for the mono and one
#' for the combo arm of a joint dose escalation design.
#'
#' @slot model (`LogisticLogNormalGrouped`)\cr the model to be used, currently only one
#' class is allowed.
#' @slot mono (`Design`)\cr defines the dose escalation rules for the mono arm, see
#' details.
#' @slot combo (`Design`)\cr defines the dose escalation rules for the combo arm, see
#' details.
#' @slot first_cohort_mono_only (`flag`)\cr whether first test one mono agent cohort, and then
#' once its DLT data has been collected, we proceed from the second cohort onwards with
#' concurrent mono and combo cohorts.
#' @slot same_dose (`flag`)\cr whether the lower dose of the separately determined mono and combo
#' doses should be used as the next dose for both mono and combo.
#'
#' @details Note that the model slots inside the `mono` and `combo` parameters
#' are ignored (because we don't fit separate regression models for the mono and
#' combo arms). Instead, the `model` parameter is used to fit a joint regression
#' model for the mono and combo arms together.
#'
#' @aliases DesignGrouped
#' @export
#'
.DesignGrouped <- setClass(
Class = "DesignGrouped",
slots = c(
model = "LogisticLogNormalGrouped",
mono = "Design",
combo = "Design",
first_cohort_mono_only = "logical",
same_dose = "logical"
),
prototype = prototype(
model = .DefaultLogisticLogNormalGrouped(),
mono = .Design(),
combo = .Design(),
first_cohort_mono_only = TRUE,
same_dose = TRUE
),
validity = v_design_grouped,
contains = "CrmPackClass"
)

## constructor ----

#' @rdname DesignGrouped-class
#'
#' @param model (`LogisticLogNormalGrouped`)\cr see slot definition.
#' @param mono (`Design`)\cr see slot definition.
#' @param combo (`Design`)\cr see slot definition.
#' @param first_cohort_mono_only (`flag`)\cr see slot definition.
#' @param same_dose (`flag`)\cr see slot definition.
#' @param ... not used.
#'
#' @export
#' @example examples/Design-class-DesignGrouped.R
#'
DesignGrouped <- function(model,
mono,
combo = mono,
first_cohort_mono_only = TRUE,
same_dose = TRUE,
...) {
.DesignGrouped(
model = model,
mono = mono,
combo = combo,
first_cohort_mono_only = first_cohort_mono_only,
same_dose = same_dose
)
}

## default constructor ----

#' @rdname DesignGrouped-class
#' @note Typically, end-users will not use the `.DefaultDesignGrouped()` function.
#' @export
.DefaultDesignGrouped <- .DesignGrouped
Loading

0 comments on commit 7c6ed0e

Please sign in to comment.