Skip to content

Commit

Permalink
Update KMG01 after g_km refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
edelarua committed Mar 21, 2024
1 parent 5f881fc commit 12b2abd
Show file tree
Hide file tree
Showing 7 changed files with 2,903 additions and 4,768 deletions.
127 changes: 121 additions & 6 deletions book/graphs/efficacy/kmg01.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ variables <- list(tte = "AVAL", is_event = "is_event", arm = "ARMCD")

## Standard Plot

::: {.content-visible when-profile="development"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot1, fig.height = 8, test = list(plot_v1 = "plot"), opts.label = "skip_test_strict"}
```{r plot1, fig.width = 9, fig.height = 6, test = list(plot_v1 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
Expand All @@ -38,11 +39,44 @@ plot <- g_km(
)
plot
```
:::

::: {.content-visible when-profile="stable"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot1-stbl, fig.height = 8, test = list(plot_v1 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
xlab = "Time (Days)",
ylim = c(0, 1),
annot_coxph = TRUE
)
plot
```
:::

## Plot of Failures

::: {.content-visible when-profile="development"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot2, fig.height = 8, test = list(plot_v2 = "plot"), opts.label = "skip_test_strict"}
```{r plot2, fig.width = 9, fig.height = 6, test = list(plot_v2 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
xlab = "Time (Days)",
yval = "Failure",
ylim = c(0, 1),
font_size = 8,
annot_coxph = TRUE,
control_annot_coxph = control_coxph_annot(x = 0.25, y = 0.85, w = 0.3)
)
plot
```
:::

::: {.content-visible when-profile="stable"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot2-stbl, fig.height = 8, test = list(plot_v2 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
Expand All @@ -57,11 +91,26 @@ plot <- g_km(
)
plot
```
:::

## Plot Without <br/> Comparative Statistics

::: {.content-visible when-profile="development"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot3, fig.width = 9, fig.height = 6, test = list(plot_v3 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
xlab = "Time (Days)",
ylim = c(0, 1)
)
plot
```
:::

::: {.content-visible when-profile="stable"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot3, fig.height = 8, test = list(plot_v3 = "plot"), opts.label = "skip_test_strict"}
```{r plot3-stbl, fig.height = 8, test = list(plot_v3 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
Expand All @@ -71,11 +120,28 @@ plot <- g_km(
)
plot
```
:::

## Plot Without <br/> Censoring Marks

::: {.content-visible when-profile="development"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot4, fig.width = 9, fig.height = 6, test = list(plot_v4 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
censor_show = FALSE,
xlab = "Time (Days)",
ylim = c(0, 1),
annot_coxph = TRUE
)
plot
```
:::

::: {.content-visible when-profile="stable"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot4, fig.height = 8, test = list(plot_v4 = "plot"), opts.label = "skip_test_strict"}
```{r plot4-stbl, fig.height = 8, test = list(plot_v4 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
Expand All @@ -86,11 +152,13 @@ plot <- g_km(
)
plot
```
:::

## Plot Modifying <br/> Censoring Marks

::: {.content-visible when-profile="development"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot5, fig.height = 8, test = list(plot_v5 = "plot"), opts.label = "skip_test_strict"}
```{r plot5, fig.width = 9, fig.height = 6, test = list(plot_v5 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
Expand All @@ -102,11 +170,29 @@ plot <- g_km(
)
plot
```
:::

::: {.content-visible when-profile="stable"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot5-stbl, fig.height = 8, test = list(plot_v5 = "plot"), opts.label = "skip_test_strict"}
plot <- g_km(
df = anl,
variables = variables,
pch = 1,
size = 2,
xlab = "Time (Days)",
ylim = c(0, 1),
annot_coxph = TRUE
)
plot
```
:::

## Plot Modifying Options for Statistics, <br/> Tie Handling, Stratification, etc.

::: {.content-visible when-profile="development"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot6, test = list(plot_v6 = "plot"), opts.label = "skip_test_strict"}
```{r plot6, fig.width = 9, fig.height = 6, test = list(plot_v6 = "plot"), opts.label = "skip_test_strict"}
variables$strata <- c("STRATA1", "STRATA2")
plot <- g_km(
df = anl,
Expand All @@ -123,6 +209,35 @@ plot <- g_km(
)
plot
```
:::

::: {.content-visible when-profile="stable"}
<!-- skip strict because of https://github.com/r-lib/gtable/pull/94 -->
```{r plot6-stbl, test = list(plot_v6 = "plot"), opts.label = "skip_test_strict"}
variables$strata <- c("STRATA1", "STRATA2")
plot <- g_km(
df = anl,
variables = variables,
control_surv = control_surv_timepoint(conf_level = 0.8),
xlab = "Time (Days)",
ylim = c(0, 1),
annot_coxph = TRUE,
control_coxph_pw = control_coxph(
pval_method = "wald",
ties = "breslow",
conf_level = 0.8
)
)
plot
```
:::

::: {.content-visible when-profile="development"}
```{r test parameters, test = list(width = "width", height = "height"), echo=FALSE}
width <- 9
height <- 6
```
:::

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

Expand Down
Loading

0 comments on commit 12b2abd

Please sign in to comment.