Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Add spending time to `sim_gs_n`

Abierto
#340 4 comentarios 0 reacciones 1 asignado Ver en GitHub

@LittleBeannie ya está trabajando en esto.

Desde el 24/7/2025.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

For group sequential designs, spending functions can be defined based on different fractions:

  • information fraction (default)
  • event fraction
  • calendar time fraction
  • minimal of planned and actual information fraction

The above 4 options is for interim analysis (IA). For final analysis (FA), there are 2 options:

  • actual information fraction
  • full alpha

To enable the above 8 options for a group sequential design, there are 2 proposed API.

API proposal 1:

sim_gs_n(
    spending_time = c("info_frac", "event_frac", "time_frac", "min_planned_actual_info_frac"),
    full_alpha_for_FA = TRUE,
    ....)

API proposal 2:

When specifying the spending time in sim_gs_n(), we may temporarily propose introducing a create_spending() function, similar to how we implemented create_cut(). For example:

create_spending_time <- function(actual_info = FALSE, 
                                 planned_info = FALSE,
                                 actual_event = FALSE, 
                                 actual_time = FALSE){...}

Since the information fraction, event fraction, and calendar time fraction can vary between simulations, the spending function should be flexible to accommodate any combination of these inputs. The idea is to specify which of info, event, and time are used to define the spending.
Below is a draft illustrating this concept (please note the syntax and grammar are for illustration and may need refinement):

# spending by information fraction only (default)
# this is the same as API 1 when spending_time = "info_frac"
sim_gs_n(spending_time = create_spending_time(actual_info = TRUE),
         full_alpha_for_FA = TRUE,
         ...)

# spending by event fraction only
# this is the same as API 1 when spending_time = "event_frac"
sim_gs_n(spending = create_spending_time(actual_event = TRUE)
         full_alpha_for_FA = TRUE,
         ...) 

# spending by calendar time fraction only
# this is the same as API 1 when spending_time = "time_frac"
sim_gs_n(spending = create_spending_time(actual_time = TRUE)
         full_alpha_for_FA = TRUE,
         ...)     

# spending by min{event fraction, calendar time fraction}
# this is the same as API 1 when spending_time = "min_planned_actual_info_frac"
sim_gs_n(spending = create_spending_time(actual_info = TRUE, planned_info = TRUE)
         full_alpha_for_FA = TRUE,
         ...)   

Comments and thoughts are welcome!!!

Lenguaje dominante
R
Estrellas
41
Forks
14
Merge medio
3 h 4 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Merck/simtrial

Todos los issues de Merck/simtrial

Issues similares

Más issues de R

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.