Description Usage Arguments Details See Also Examples

View source: R/09-stepp-plot-function.r

this function produces a plot of using the approach "Subpopulation Treatment Effect Pattern Plot". It shows the treatment effect size of subgroups, where subgruops are defined by certain ranges of a continuous covariate; each subgroup has a sample size close to a pre-specified value (N2) and any neighboring subgroups have an overlap size near another pre-specified value (N1). The plot shows the 95 a horizontal line). The y-coordinate of a point indicates the effect size within the corresponding subgroup; the x-coordinate shows the lower bound of the range which defines the subgroup. If part of the horizontal line is out of the simultaneous C.I., it may reveal hetergeneity across subgroup effects with repective to the overall effect. In addition, one can control the width of the C.I. by controlling Type I error rate in one of the function arguments. Note that the function uses log odd ratio and log hazard ratio for displaying subgroup effect sizes in binary and survival data, respectively. The actual subgroup sample sizes over the covariate are shown on the console window as well.

1 2 3 4 5 6 7 8 9 10 11 12 13 |

`dat` |
a data set |

`covari.sel` |
a vector of indices of the two covariates |

`trt.sel` |
a variate index specifying the treatment code |

`resp.sel` |
a variate index specifying the response variable |

`outcome.type` |
a string specifying the type of the response variable, it can be "continuous", or "binary" or "survival". |

`setup.ss` |
a vector specifying the approximate overlap size (N2) and subgroup sample size (N1). |

`alpha` |
the type I error rate |

`font.size` |
a vector specifying the size of labels and text; the first element is for main titles, the second is for for x-axis and y-axis labels; the thrid is for the text in the legend; the fourth is for the subtitle. |

`title` |
a string specifying the main title. |

`lab.y` |
a string specifying the labels of the y-axis. |

`subtitle` |
strings specifying the subtitle |

Contrary to `ggplot_stepp`

, `plot_stepp`

implements an x-axis where each midpoint of the subgroups is drawn equidistant.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ```
# Load the data to be used
data(prca)
dat <- prca
## 9. stepp Plot -----------------------------------------------------------
lab.y.title = paste("Treatment effect size (log-hazard ratio)");
setup.ss = c(30,40)
sub.title = paste0("(Subgroup sample sizes are set to ", setup.ss[2],
"; overlap sizes are set to ", setup.ss[1], ")" )
plot_stepp(dat,
covari.sel = 8,
trt.sel = 3,
resp.sel = c(1, 2),
outcome.type = "survival",
setup.ss = c(30,40),
alpha = 0.05,
font.size = c(0.9, 1, 1, 1),
title = NULL,
lab.y = lab.y.title,
subtitle = sub.title)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.