Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update KMG01 after g_km refactor #239

Merged
merged 3 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"}
Melkiades marked this conversation as resolved.
Show resolved Hide resolved
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
Loading