rpact-com / rpact

rpact: Confirmatory Adaptive Clinical Trial Design and Analysis
https://rpact-com.github.io/rpact/
23 stars 5 forks source link

Enhancement Suggestion and Bug Report for getSimulationEnrichmentMeans() #61

Open fpahlke opened 2 weeks ago

fpahlke commented 2 weeks ago

Enhancement Suggestion

I have noticed that the sample size of the subpopulation is fixed in the .data dataset embedded within the object returned by getSimulationEnrichmentMeans (i.e., SS at IA * prevalence) and is not random. This allowed me to calculate the conditional power in the subpopulation, so my issue is resolved.

However, based on my experience, this data generation approach does not reflect reality in most cases. The number of patients in the subpopulation at the interim analysis (IA) is typically a random variable and not known beforehand. I believe that the variability in subpopulation sample size at IA can significantly impact the operating characteristics of an enrichment design and should be considered.

To account for this, it would be necessary to generate the subpopulation sample size randomly and provide the realized sample sizes to the selectPopulationsFunction and calcSubjectsFunction. Perhaps this could be an idea for a future enhancement.


Bug Report

In the .data dataset contained in the result of getSimulationEnrichmentMeans, the variables numberOfSubjects and numberOfCumulatedSubjects are not represented correctly. Both variables sum the sample size of the subpopulation with the sample size of the full population. However, since the subpopulation is already part of the full population, this results in double-counting the subpopulation.

The correct sample sizes are only available in the subjectsPopulation variable.

gwassmer commented 2 days ago

I agree, the number of patients in a sub-population is typically a random variable. However, we have investigated this: for the simulations there is no relevant effect on the test characteristics when using fixed sample sizes as compared to a random sample size. That's the reason why we decided to take it non-random.

gwassmer commented 2 days ago

The bug will be fixed