Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent result on probabilities of stopping for futility when all populations are not selected in getSimulationEnrichmentRates() for rpact version 3.4.0 and 3.5.0 #17

Closed
fpahlke opened this issue Feb 9, 2024 · 1 comment
Labels
invalid This doesn't seem right

Comments

@fpahlke
Copy link
Member

fpahlke commented Feb 9, 2024

We are working on a three-stage design for binary outcomes with adaptation of populations at the first interim using rpact. The OBF alpha spending function is used for efficacy. We consider two population selection, and the futility only happens when none of the population could meet the selection criteria. We implement this futility criteria in a customized population selection function for getSimulationEnrichmentRates().

We were working on rpact 3.4.0 (R version 4.1.0) and the simulation results look reasonable. However, when we are using the latest version (3.5.0), the futility probabilities at the first interim becomes zero for all simulation scenarios. We attached the code for a simplified version of our design for illustration. We developed the selection criteria using predictive probabilities for our project, but for this simplified one we only use the effect estimates, which requires at least 25% reduction from the assumed placebo rate (10%). The results are

Futility stop per stage [1]: 0.0820, 0.1050, 0.4650 (version 3.4.0)
Futility stop per stage [1]: 0.0000, 0.0000, 0.0000 (version 3.5.0)

Could you please help us to figure out what is going wrong?

Example:

library(rpact)

# Define design
ind <- getDesignInverseNormal(  
  kMax = 3,
  alpha = 0.025, 
  beta = 0.1, 
  sided = 1, 
  informationRates = c(530, 706, 1176)/1176,
  #futilityBounds = c(0, 1),
  typeOfDesign = "asOF", 
  typeBetaSpending = "none")

getPowerRates(
  design = ind,
  groups = 2,
  riskRatio = FALSE,
  thetaH0 = 0,
  pi1 = 10/100*0.5,
  pi2 = 10/100,
  directionUpper = FALSE,
  maxNumberOfSubjects = 1176,
  allocationRatioPlanned = 1) |> summary()

# Define selection function
mySelection <- function(effectVector, stage) {
  selectedPopulations <- rep(TRUE, 2)
  if (stage == 1) {
    selectedPopulations <- rep(FALSE, 2) 
    if (effectVector[2] / 0.1 >= 0.25)  
      selectedPopulations[2] = TRUE 
    else if (effectVector[1] / 0.1 >= 0.25) 
      selectedPopulations[1] = TRUE 
  }
  return(selectedPopulations)
}

# Perform simulation
simResults <- getSimulationEnrichmentRates(
  design = ind,
  effectList = list(
    subGroups = c("S", "R"),  
    prevalences = c(0.5, 0.5),
    piControl = rep(10/100, 2), 
    piTreatments = matrix(
      c( 5/100, 5/100,
         5/100, 5/100,
        10/100, 5/100), ncol = 2, byrow = TRUE)),
  intersectionTest = "Simes",
  stratifiedAnalysis = FALSE, 
  directionUpper = FALSE,
  typeOfSelection = "userDefined", 
  effectMeasure = "effectEstimate",
  successCriterion = "all",
  plannedSubjects = c(530, 706, 1176),
  maxNumberOfIterations = 1000,
  seed = 1234,
  selectPopulationsFunction = mySelection)

print(simResults)
fpahlke added a commit that referenced this issue Feb 9, 2024
* The fields `.parameterNames` and `.parameterFormatFunctions` were removed from all rpact result objects in favor of a more efficient solution
* Issues [15](#15), [16](#16), and [17](#17) fixed
@fpahlke
Copy link
Member Author

fpahlke commented Feb 9, 2024

Fixed in branch dev/3.5.1

@fpahlke fpahlke closed this as completed Feb 9, 2024
@fpahlke fpahlke added the invalid This doesn't seem right label Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant