@@ -22,9 +22,7 @@ knitr::opts_chunk$set(echo = TRUE)
22
22
23
23
``` {r, message=FALSE, warning=FALSE}
24
24
library(gsDesign2)
25
- library(tibble)
26
25
library(gt)
27
- library(dplyr)
28
26
```
29
27
30
28
# Design assumptions
@@ -118,13 +116,13 @@ over the targeted 90\%.
118
116
x |>
119
117
summary() |>
120
118
as_gt() |>
121
- gt:: tab_header(title = "Original design") |>
122
- gt:: tab_style(
119
+ tab_header(title = "Original design") |>
120
+ tab_style(
123
121
style = list(
124
- gt:: cell_fill(color = "lightcyan"),
125
- gt:: cell_text(weight = "bold")
122
+ cell_fill(color = "lightcyan"),
123
+ cell_text(weight = "bold")
126
124
),
127
- locations = gt:: cells_body(
125
+ locations = cells_body(
128
126
columns = Z,
129
127
rows = Bound == "Efficacy"
130
128
)
@@ -152,32 +150,37 @@ observed_data <- simtrial::sim_pw_surv(
152
150
)
153
151
154
152
observed_data_ia <- observed_data |> simtrial::cut_data_by_date(analysis_time[1])
155
- observed_data_fa <- observed_data |> simtrial::cut_data_by_date(analysis_time[2])
153
+ observed_data_fa <- observed_data |> simtrial::cut_data_by_date(analysis_time[2])
156
154
```
157
155
158
156
The updated design is
159
157
``` {r}
160
- gs_update_ahr(x = x,
161
- ia_alpha_spending = "actual_info_frac",
162
- fa_alpha_spending = "full_alpha",
163
- observed_data = list(observed_data_ia, observed_data_fa)) |>
164
- summary(col_vars = c("analysis", "bound", "z", "~hr at bound",
165
- "nominal p", "Alternate hypothesis", "Null hypothesis"),
166
- col_decimals = c(NA, NA, 4, 4, 4, 4, 4)) |>
158
+ gs_update_ahr(
159
+ x = x,
160
+ ia_alpha_spending = "actual_info_frac",
161
+ fa_alpha_spending = "full_alpha",
162
+ observed_data = list(observed_data_ia, observed_data_fa)
163
+ ) |>
164
+ summary(
165
+ col_vars = c(
166
+ "analysis", "bound", "z", "~hr at bound",
167
+ "nominal p", "Alternate hypothesis", "Null hypothesis"
168
+ ),
169
+ col_decimals = c(NA, NA, 4, 4, 4, 4, 4)
170
+ ) |>
167
171
as_gt() |>
168
- gt:: tab_style(
172
+ tab_style(
169
173
style = list(
170
- gt:: cell_fill(color = "lightcyan"),
171
- gt:: cell_text(weight = "bold")
174
+ cell_fill(color = "lightcyan"),
175
+ cell_text(weight = "bold")
172
176
),
173
- locations = gt:: cells_body(
177
+ locations = cells_body(
174
178
columns = Z,
175
179
rows = Bound == "Efficacy"
176
180
)
177
181
)
178
182
```
179
183
180
-
181
184
# Two-sided asymmetric design, beta-spending with non-binding lower bound {.tabset}
182
185
183
186
In this section, we investigate a 2 sided asymmetric design, with the
@@ -232,62 +235,67 @@ larger than what we have in the 1-sided example.
232
235
x |>
233
236
summary() |>
234
237
as_gt() |>
235
- gt:: tab_header(title = "Original design") |>
236
- gt:: tab_style(
238
+ tab_header(title = "Original design") |>
239
+ tab_style(
237
240
style = list(
238
- gt:: cell_fill(color = "lightcyan"),
239
- gt:: cell_text(weight = "bold")
241
+ cell_fill(color = "lightcyan"),
242
+ cell_text(weight = "bold")
240
243
),
241
- locations = gt:: cells_body(
244
+ locations = cells_body(
242
245
columns = Z,
243
246
rows = Bound == "Efficacy"
244
247
)
245
248
) |>
246
- gt:: tab_style(
249
+ tab_style(
247
250
style = list(
248
- gt:: cell_fill(color = "#F9E3D6"),
249
- gt:: cell_text(weight = "bold")
251
+ cell_fill(color = "#F9E3D6"),
252
+ cell_text(weight = "bold")
250
253
),
251
- locations = gt:: cells_body(
254
+ locations = cells_body(
252
255
columns = Z,
253
256
rows = Bound == "Futility"
254
257
)
255
258
)
256
259
```
257
260
258
- For simplicity in presentation, we assume the observed events are the same as that in the 1-sided design.
261
+ For simplicity in presentation, we assume the observed events are the same as that in the 1-sided design.
259
262
260
263
The updated design is
261
264
``` {r}
262
- gs_update_ahr(x = x,
263
- ia_alpha_spending = "actual_info_frac",
264
- fa_alpha_spending = "full_alpha",
265
- observed_data = list(observed_data_ia, observed_data_fa)) |>
266
- summary(col_vars = c("analysis", "bound", "z", "~hr at bound",
267
- "nominal p", "Alternate hypothesis", "Null hypothesis"),
268
- col_decimals = c(NA, NA, 4, 4, 4, 4, 4)) |>
265
+ gs_update_ahr(
266
+ x = x,
267
+ ia_alpha_spending = "actual_info_frac",
268
+ fa_alpha_spending = "full_alpha",
269
+ observed_data = list(observed_data_ia, observed_data_fa)
270
+ ) |>
271
+ summary(
272
+ col_vars = c(
273
+ "analysis", "bound", "z", "~hr at bound",
274
+ "nominal p", "Alternate hypothesis", "Null hypothesis"
275
+ ),
276
+ col_decimals = c(NA, NA, 4, 4, 4, 4, 4)
277
+ ) |>
269
278
as_gt() |>
270
- gt:: tab_style(
279
+ tab_style(
271
280
style = list(
272
- gt:: cell_fill(color = "lightcyan"),
273
- gt:: cell_text(weight = "bold")
281
+ cell_fill(color = "lightcyan"),
282
+ cell_text(weight = "bold")
274
283
),
275
- locations = gt:: cells_body(
284
+ locations = cells_body(
276
285
columns = Z,
277
286
rows = Bound == "Efficacy"
278
287
)
279
288
) |>
280
- gt:: tab_style(
289
+ tab_style(
281
290
style = list(
282
- gt:: cell_fill(color = "#F9E3D6"),
283
- gt:: cell_text(weight = "bold")
291
+ cell_fill(color = "#F9E3D6"),
292
+ cell_text(weight = "bold")
284
293
),
285
- locations = gt:: cells_body(
294
+ locations = cells_body(
286
295
columns = Z,
287
296
rows = Bound == "Futility"
288
297
)
289
298
)
290
299
```
291
300
292
-
293
301
# References
0 commit comments