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

Index Error #47

Closed
zhuob opened this issue Aug 9, 2024 · 2 comments
Closed

Index Error #47

zhuob opened this issue Aug 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@zhuob
Copy link

zhuob commented Aug 9, 2024

Dear rpact team,

Recently I used the package to do some simple simulation, and I experienced some issue "Error: index error". Below is the minimal code needed to reproduce the error. I looked into the getSimulationSurvival function, and it seems the problem is related to a C function "_rpact_getSimulationSurvivalCpp". Hope you can resolve the issue.

n_subj1 <- 3264

accrual_time1 <- getAccrualTime(
accrualTime = c(0, (20/3), (20/3)*2, (20/3)*3),
accrualIntensity = n_subj1 * c(0.10, 0.35, 0.55)/(20/3)
)

design1 <- getDesignGroupSequential(
typeOfDesign = "asHSD",
gammaA = -8,
informationRates = c(0.6, 1),
beta = 0.1,
alpha = 0.025
)

design_plan1 <- getSampleSizeSurvival(
design1,
pi2 = 0.0781,
hazardRatio = 0.76,
accrualTime = accrual_time1,
eventTime = 12
)

sim1 <- getSimulationSurvival(
design = design1,
pi2 = 0.0781,
directionUpper = FALSE,
hazardRatio = 0.76,
accrualTime = accrual_time1,
eventTime = 12,
plannedEvents = as.numeric(ceiling(design_plan1$eventsPerStage)),
maxNumberOfIterations = 1e2,
longTimeSimulationAllowed = TRUE,
maxNumberOfRawDatasetsPerStage = 1e2
)

@gwassmer
Copy link
Collaborator

gwassmer commented Aug 9, 2024

Strange, the code works for n_subj1 <- 3265 (or other values than 3264)
Thank you, we will fix the issue!

@fpahlke fpahlke added the bug Something isn't working label Aug 14, 2024
fpahlke added a commit that referenced this issue Aug 15, 2024
fpahlke added a commit that referenced this issue Aug 16, 2024
@fpahlke
Copy link
Member

fpahlke commented Aug 16, 2024

Fixed in pull request 48.

@fpahlke fpahlke closed this as completed Aug 16, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants