Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: crmPack
Title: Object-Oriented Implementation of Dose Escalation Designs
Version: 2.0.1
Version: 2.0.2
Authors@R: c(
person("Daniel", "Sabanes Bove", , "[email protected]", role = c("aut", "cre")),
person("Wai", "Yin Yeung", , "[email protected]", role = "aut"),
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Version 2.0.2

### Miscellaneous

* Fixed logging tests which had been broken by recent `futile.logger` updates.

# Version 2.0.1

### Bugfixes
Expand Down
10 changes: 10 additions & 0 deletions design/check-timings.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Run R CMD check (also devtools::check will include the --timings flag),
# then read the timings file and show the top 10 longest running examples:

timings <- read.table("../crmPack.Rcheck/crmPack-Ex.timings", header = TRUE)

library(dplyr)

timings |>
arrange(-elapsed) |>
head(10)
2 changes: 1 addition & 1 deletion examples/Design-class-DADesign.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ my_stopping1 <- StoppingTargetProb(

my_stopping2 <- StoppingMinPatients(nPatients = 50)

my_stopping <- (my_stopping1 | my_stopping2)
my_stopping <- (my_stopping1 | my_stopping2) | StoppingMissingDose()

my_safety_window <- SafetyWindowConst(c(6, 2), 7, 7)

Expand Down
4 changes: 3 additions & 1 deletion examples/Design-class-Design.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ my_stopping2 <- StoppingTargetProb(
prob = 0.5
)
my_stopping3 <- StoppingMinPatients(nPatients = 20)
my_stopping <- (my_stopping1 & my_stopping2) | my_stopping3
my_stopping <- (my_stopping1 & my_stopping2) |
my_stopping3 |
StoppingMissingDose()

# Choose the rule for dose increments.
my_increments <- IncrementsRelative(
Expand Down
4 changes: 3 additions & 1 deletion examples/Design-class-DesignGrouped.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ my_stopping2 <- StoppingTargetProb(
prob = 0.5
)
my_stopping3 <- StoppingMinPatients(nPatients = 20)
my_stopping <- (my_stopping1 & my_stopping2) | my_stopping3
my_stopping <- (my_stopping1 & my_stopping2) |
my_stopping3 |
StoppingMissingDose()

# Choose the rule for dose increments.
my_increments <- IncrementsRelative(
Expand Down
5 changes: 4 additions & 1 deletion examples/Design-class-DesignOrdinal.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ my_stopping2 <- StoppingTargetProb(
prob = 0.5
)
my_stopping3 <- StoppingMinPatients(nPatients = 20)
my_stopping <- StoppingOrdinal(1L, (my_stopping1 & my_stopping2) | my_stopping3)
my_stopping <- StoppingOrdinal(
1L,
(my_stopping1 & my_stopping2) | my_stopping3 | StoppingMissingDose()
)

# Initialize the design.
design <- DesignOrdinal(
Expand Down
2 changes: 1 addition & 1 deletion examples/Design-class-DualDesign.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ my_stopping1 <- StoppingTargetBiomarker(
target = c(0.9, 1),
prob = 0.5
)
my_stopping <- my_stopping1 | StoppingMinPatients(40)
my_stopping <- my_stopping1 | StoppingMinPatients(40) | StoppingMissingDose()

# Choose the rule for dose increments.
my_increments <- IncrementsRelative(
Expand Down
2 changes: 1 addition & 1 deletion examples/Design-class-DualResponsesDesign.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ my_increments <- IncrementsRelative(
)

my_size <- CohortSizeConst(size = 3)
my_stopping <- StoppingMinPatients(nPatients = 36)
my_stopping <- StoppingMinPatients(nPatients = 36) | StoppingMissingDose()

design <- DualResponsesDesign(
nextBest = my_next_best,
Expand Down
2 changes: 1 addition & 1 deletion examples/Design-class-DualResponsesSamplesDesign.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ my_increments <- IncrementsRelative(
increments = c(2, 2)
)
my_size <- CohortSizeConst(size = 3)
my_stopping <- StoppingMinPatients(nPatients = 36)
my_stopping <- StoppingMinPatients(nPatients = 36) | StoppingMissingDose()

design <- DualResponsesSamplesDesign(
nextBest = my_next_best,
Expand Down
2 changes: 1 addition & 1 deletion examples/Design-class-TDDesign.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ my_increments <- IncrementsRelative(
)

# Stop when the maximum sample size of 36 patients is reached.
my_stopping <- StoppingMinPatients(nPatients = 36)
my_stopping <- StoppingMinPatients(nPatients = 36) | StoppingMissingDose()

# The design with all the above information and starting with a dose of 25.
# This design incorporates only DLT responses and no DLT samples are involved
Expand Down
2 changes: 1 addition & 1 deletion examples/Design-class-TDsamplesDesign.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ my_increments <- IncrementsRelative(
)

# Stop when the maximum sample size of 36 patients is reached.
my_stopping <- StoppingMinPatients(nPatients = 36)
my_stopping <- StoppingMinPatients(nPatients = 36) | StoppingMissingDose()

# The design with all the above information and starting with a dose of 25.
design <- TDsamplesDesign(
Expand Down
2 changes: 2 additions & 0 deletions examples/Design-method-simulate-DesignGrouped.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ legend("topright", c("mono", "combo"), lty = c(1, 2), col = c(1, 2))

# Start the simulations.
set.seed(123)
\donttest{
my_sims <- simulate(
my_design,
nsim = 1, # This should be at least 100 in actual applications.
Expand All @@ -74,3 +75,4 @@ plot(combo_sims_sum)
trial_index <- 1
plot(my_sims$mono@data[[trial_index]])
plot(my_sims$combo@data[[trial_index]])
}
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestDualEndpoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ my_model <- DualEndpointRW(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)

\donttest{
my_samples <- mcmc(my_data, my_model, my_options)
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestEWOC.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestMTD.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestMaxGainSamples.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ my_model_effll <- Effloglog(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples_dlt <- mcmc(my_data, my_model_dlt, my_options)
my_samples_effll <- mcmc(my_data, my_model_effll, my_options)

Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestMinDist.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ my_model <- LogisticKadaneBetaGamma(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestNCRM-DataParts.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestNCRM.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestNCRMLoss.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestProbMTDLTE.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-nextBest-NextBestProbMtdMinDist.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ my_model <- my_model <- LogisticKadaneBetaGamma(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 50)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingAll.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingAny.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingHighestDose.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingList.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
\donttest{
samples <- mcmc(data, model, options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down Expand Up @@ -66,3 +67,4 @@ stopTrial(
model = model,
data = data
)
}
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingMTDCV.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 40)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingMinCohorts.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingMinPatients.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingMissingDose.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 40)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule for dose increments and calculate the maximum dose allowed.
Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingOrdinal.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
data <- .DefaultDataOrdinal()
model <- .DefaultLogisticLogNormalOrdinal()
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
samples <- mcmc(data, model, options)

myIncrements <- .DefaultIncrementsOrdinal()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingSpecificDose.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ my_model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior.
my_options <- McmcOptions(burnin = 10, step = 2, samples = 40)
my_options <- McmcOptions(burnin = 5, step = 1, samples = 10)
my_samples <- mcmc(my_data, my_model, my_options)

# Define the rule which will be used to select the next best dose
Expand Down
5 changes: 3 additions & 2 deletions examples/Rules-method-stopTrial-StoppingTargetBiomarker.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ model <- DualEndpointRW(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
\donttest{
samples <- mcmc(data, model, options)

# Define the rule for dose increments and calculate the maximum dose allowed
Expand Down Expand Up @@ -79,5 +80,5 @@ stopTrial(
model = model,
data = data
)

}
# nolint end
2 changes: 1 addition & 1 deletion examples/Rules-method-stopTrial-StoppingTargetProb.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ model <- LogisticLogNormal(
)

# Set-up some MCMC parameters and generate samples from the posterior
options <- McmcOptions(burnin = 10, step = 2, samples = 40)
options <- McmcOptions(burnin = 5, step = 1, samples = 10)
set.seed(94)
samples <- mcmc(data, model, options)

Expand Down
Loading
Loading