Skip to content

Commit 06d37ad

Browse files
committed
update vignettes after "gbsg superseded"
1 parent 834d838 commit 06d37ad

6 files changed

Lines changed: 263 additions & 127 deletions

File tree

NEWS.md

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,42 +5,42 @@
55
### New functions
66

77
* `generate_aft_dgm_flex()` — general data-generating model (DGM) builder.
8-
Replaces the GBSG-specific `create_gbsg_dgm()` as the primary DGM
9-
constructor. Accepts any survival dataset and fits an accelerated failure
10-
time (AFT) super-population model with user-specified treatment effect
11-
heterogeneity parameters.
8+
Accepts any survival dataset and fits an accelerated failure time (AFT)
9+
super-population model with user-specified treatment effect heterogeneity
10+
parameters. This is the recommended starting point when building a DGM
11+
based on a dataset other than GBSG.
1212

1313
* `simulate_from_dgm()` — general simulator for drawing trial replicates from
14-
an `aft_dgm_flex` DGM. Replaces `simulate_from_gbsg_dgm()`. Column names
15-
in the returned data frame use underscore notation (`y_sim`, `event_sim`,
16-
`treat_sim`, `flag_harm`).
14+
an `aft_dgm_flex` DGM. Supersedes `simulate_from_gbsg_dgm()` for new code.
15+
Column names in the returned data frame use underscore notation (`y_sim`,
16+
`event_sim`, `treat_sim`, `flag_harm`).
1717

1818
* `run_simulation_analysis()` (general version) — simulation wrapper that
1919
calls `simulate_from_dgm()` and accepts explicit column-name parameters,
20-
making it applicable to any DGM built with `generate_aft_dgm_flex()`. The
21-
GBSG dataset is now one application of this general pipeline rather than a
22-
separate code path.
23-
24-
* `setup_gbsg_dgm()`convenience bridge function. Wraps
25-
`create_gbsg_dgm()` (see Deprecated below) and reshapes its output to the
26-
`aft_dgm_flex` class expected by `simulate_from_dgm()` and
27-
`run_simulation_analysis()`. Existing GBSG-based simulation scripts can
28-
adopt the general pipeline with a one-line change:
20+
making it applicable to any DGM built with `generate_aft_dgm_flex()` or
21+
`setup_gbsg_dgm()`. The GBSG dataset is one application of this general
22+
pipeline rather than a separate code path.
23+
24+
* `setup_gbsg_dgm()`the recommended entry point for all GBSG-based
25+
simulation work. Encodes the data preparation and subgroup definition from
26+
León et al. (2024) and returns an `aft_dgm_flex`-compatible object accepted
27+
by `simulate_from_dgm()` and `run_simulation_analysis()`. Existing scripts
28+
using `create_gbsg_dgm()` can migrate with a one-line change:
2929
`dgm <- setup_gbsg_dgm(model = "alt", k_inter = k, seed = seed)`.
3030

31-
### Deprecated functions
31+
### Superseded functions
3232

33-
The following functions are retained and fully functional but will be removed
34-
in a future version. Each emits a deprecation warning on first call with a
35-
concrete migration example.
33+
`create_gbsg_dgm()` is superseded by `setup_gbsg_dgm()`. It remains fully
34+
functional and continues to produce correct results; no existing GBSG
35+
simulation scripts need to change. The distinction is that `setup_gbsg_dgm()`
36+
returns an object of class `c("aft_dgm_flex", "gbsg_dgm")` compatible with
37+
the general pipeline, whereas `create_gbsg_dgm()` returns only `"gbsg_dgm"`.
38+
A `.Deprecated()` signal is emitted to encourage migration in new code.
3639

37-
* `create_gbsg_dgm()` → use `generate_aft_dgm_flex()` or `setup_gbsg_dgm()`.
38-
39-
* `simulate_from_gbsg_dgm()` → use `simulate_from_dgm(analysis_time = Inf)`.
40-
Note: the new function defaults to `analysis_time = 48` (staggered-entry
41-
administrative censoring); pass `analysis_time = Inf` to match the legacy
42-
`max_follow = Inf` behaviour. Column names in the result also change — see
43-
the mapping table below.
40+
`simulate_from_gbsg_dgm()` is superseded by `simulate_from_dgm()` for new
41+
code. Column names in the output change from dot-notation to underscore
42+
notation — see the mapping table below. Pass `analysis_time = Inf` to match
43+
the legacy `max_follow = Inf` behaviour.
4444

4545
| Legacy column | General column |
4646
|---------------|----------------|
@@ -49,13 +49,13 @@ concrete migration example.
4949
| `treat` | `treat_sim` |
5050
| `flag.harm` | `flag_harm` |
5151

52-
### Deprecated parameters
52+
### Superseded parameters
5353

5454
* `run_simulation_analysis(max_follow)` → use `analysis_time`. If supplied,
55-
`max_follow` is silently forwarded to `analysis_time` with a warning.
55+
`max_follow` is forwarded to `analysis_time` with a warning.
5656

5757
* `run_simulation_analysis(muC_adj)` → use `cens_adjust`. If supplied,
58-
`muC_adj` is silently forwarded to `cens_adjust` with a warning.
58+
`muC_adj` is forwarded to `cens_adjust` with a warning.
5959

6060
### Bug fixes
6161

@@ -92,9 +92,9 @@ migration. All affected code paths were exercised by GBSG factor variables
9292

9393
* `create_gbsg_dgm()` and `simulate_from_gbsg_dgm()` are now thin public
9494
wrappers that call `.create_gbsg_dgm_()` and `.simulate_from_gbsg_dgm_()`
95-
internally. This prevents deprecation-warning spam in functions that call
96-
these internally in loops or binary searches (`calibrate_k_inter()`,
97-
`get_dgm_with_output()`, `validate_k_inter_effect()`).
95+
internally. This prevents warning spam in functions that call these
96+
in loops or binary searches (`calibrate_k_inter()`, `get_dgm_with_output()`,
97+
`validate_k_inter_effect()`).
9898

9999
* `compute_dgm_cde()` now resolves the super-population data frame from
100100
`dgm$df_super_rand` (GBSG DGMs) or `dgm$df_super` (general `aft_dgm_flex`

R/setup_gbsg_dgm.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
#' sim <- simulate_from_dgm(dgm, n = 400, seed = 1)
6565
#' }
6666
#'
67-
#' @importFrom survival gbsg
6867
#' @export
6968
setup_gbsg_dgm <- function(
7069
model = c("alt", "null"),

dev/devtools_package.R

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,6 @@ devtools::install(quick = TRUE)
144144

145145
devtools::install(dependencies = FALSE)
146146

147-
148147
# In RStudio, from the forestsearch project directory:
149148
devtools::clean_dll()
150149
devtools::document()

vignettes/articles/extreme_subgroups.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ knitr::opts_chunk$set(
3434
3535
# Number of null-DGM simulated trials — the primary result quantity
3636
# Set to>= 1000 for publication-quality results
37-
n_sims_null <- 99L
37+
n_sims_null <- 133L
3838
3939
4040
```

0 commit comments

Comments
 (0)