Skip to content

Commit

Permalink
Update use of deprecated strat argument from tern (#220)
Browse files Browse the repository at this point in the history
Closes #219
  • Loading branch information
edelarua authored Feb 25, 2024
1 parent 180f125 commit 700994b
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 8 deletions.
2 changes: 1 addition & 1 deletion book/graphs/other/kmg01.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ plot
## Plot Modifying Options for Statistics, <br/> Tie Handling, Stratification, etc.

```{r plot6, test = list(plot_v6 = "plot")}
variables$strat <- c("STRATA1", "STRATA2")
variables$strata <- c("STRATA1", "STRATA2")
plot <- g_km(
df = anl,
variables = variables,
Expand Down
2 changes: 0 additions & 2 deletions book/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,4 @@ title: "TLG Catalog"
subtitle: "Tables, Listings, and Graphs Catalog"
---

<img src="./assets/img/logo.png" style="float: right;" width="200;"/>

{{< include README.md >}}
67 changes: 64 additions & 3 deletions book/tables/efficacy/ttet01.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ subtitle: Time-To-Event Summary

{{< include ../../test-utils/envir_hook.qmd >}}

::: panel-tabset
::::: panel-tabset
## Data Setup

```{r setup, message=FALSE}
Expand Down Expand Up @@ -209,7 +209,8 @@ result

## Table with <br/> Stratified Analysis

```{r variant4, test = list(result_v4 = "result")}
::: {.content-visible when-profile="stable"}
```{r variant4-stable}
lyt <- basic_table(show_colcounts = TRUE) %>%
split_cols_by("ARM", ref_group = "A: Drug X") %>%
analyze_vars(
Expand Down Expand Up @@ -265,6 +266,66 @@ result <- build_table(lyt, df = adtte_f, alt_counts_df = adsl) %>%
result
```
:::

::: {.content-visible when-profile="development"}
```{r variant4-devel, test = list(result_v4 = "result")}
lyt <- basic_table(show_colcounts = TRUE) %>%
split_cols_by("ARM", ref_group = "A: Drug X") %>%
analyze_vars(
vars = "is_event",
.stats = "count_fraction",
.labels = c(count_fraction = "Patients with event (%)")
) %>%
split_rows_by(
"EVNT1",
split_label = "Earliest contributing event",
split_fun = keep_split_levels("Patients with event (%)"),
label_pos = "visible",
child_labels = "hidden",
indent_mod = 1L,
) %>%
analyze("EVNTDESC") %>%
analyze_vars(
vars = "is_not_event",
.stats = "count_fraction",
.labels = c(count_fraction = "Patients without event (%)"),
nested = FALSE,
show_labels = "hidden"
) %>%
surv_time(
vars = "AVAL",
var_labels = "Time to Event (Months)",
is_event = "is_event",
table_names = "time_to_event"
) %>%
coxph_pairwise(
vars = "AVAL",
is_event = "is_event",
var_labels = "Unstratified Analysis",
table_names = "coxph_unstratified"
) %>%
coxph_pairwise(
vars = "AVAL",
is_event = "is_event",
var_labels = "Stratified Analysis",
strata = "SEX",
table_names = "coxph_stratified"
) %>%
surv_timepoint(
vars = "AVAL",
var_labels = "Months",
is_event = "is_event",
method = "both",
time_point = 12
)
result <- build_table(lyt, df = adtte_f, alt_counts_df = adsl) %>%
prune_table()
result
```
:::

## Table Modifying Time Point for <br/> the "XX Months" Analysis

Expand Down Expand Up @@ -461,4 +522,4 @@ shinyApp(app$ui, app$server)
```

{{< include ../../repro.qmd >}}
:::
:::::
2 changes: 1 addition & 1 deletion book/tables/lab-results/lbt11.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ lyt <- basic_table(show_colcounts = TRUE) %>%
vars = "AVAL",
is_event = "is_event",
var_labels = paste0("Stratified By: ", paste(strata, collapse = ", ")),
strat = strata,
strata = strata,
table_names = "coxph_stratified"
)
Expand Down
2 changes: 1 addition & 1 deletion book/tables/lab-results/lbt11_bl.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ lyt <- basic_table(show_colcounts = TRUE) %>%
vars = "AVAL",
is_event = "is_event",
var_labels = paste0("Stratified By: ", paste(strata, collapse = ", ")),
strat = strata,
strata = strata,
table_names = "coxph_stratified"
)
Expand Down

0 comments on commit 700994b

Please sign in to comment.