Description Usage Arguments Value Author(s)
This function produces plots of risk differences over time using ggplot2
.
As a first argument it needs a dataset of risk differences produced by link{get_RDs}
.
See http://ggobi.github.io/ggally/#ggallyggsurv for additional modifications of the resulting output plot.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ggRD(
RDests,
CI = TRUE,
CI_errorbar = FALSE,
CI_line = FALSE,
plot_cens = TRUE,
surv_col = "gg.def",
cens_col = "gg.def",
lty_est = 1,
shape_est = seq_along(RDests),
lty_ci = 2,
size_est = 0.5,
size_ci = size_est,
size_pt = size_est + 0.3,
cens_size = 2,
cens_shape = 3,
back_white = TRUE,
xlab = "Time",
ylab = "Risk Difference",
main = "",
legend_pos = "right",
RD_name = "RD",
SE_name = "RD.SE",
CIlow_name = "CI95low",
CIup_name = "CI95up",
order_legend = TRUE,
t_int_sel = NULL,
ymin = NULL,
ymax = NULL,
facet = FALSE,
font_size = 6,
line_RD_plot = TRUE,
x_breaks = unique(RDests[["time"]]),
axis_font_size = NULL,
x_axis_font_angle = 0,
...
)
|
RDests |
A table in long format with a single column containing names of two contrasting regimens. Each list item must be a data.frame containing the risk difference estimates over time. |
CI |
should a 95% confidence interval be plotted? Defaults to |
CI_errorbar |
Plot CIs as error bars around point estimates, default is |
CI_line |
When |
plot_cens |
mark the censored observations? |
surv_col |
colour of the survival estimate. Defaults to black for
one stratum, and to the default |
cens_col |
colour of the points that mark censored observations. |
lty_est |
linetype of the survival curve(s). Vector length should be either 1 or equal to the number of strata. |
shape_est |
shape type of the survival point RDests. Vector length should be either 1 or equal to the number of strata. |
lty_ci |
linetype of the bounds that mark the 95% CI. |
size_est |
line width of the survival curve |
size_ci |
line width of the 95% CI |
size_pt |
point size of the survival estimate at each time-point |
cens_size |
point size of the censoring points |
cens_shape |
shape of the points that mark censored observations. |
back_white |
if |
xlab |
the label of the x-axis. |
ylab |
the label of the y-axis. |
main |
the plot label. |
legend_pos |
Either the coordinates of the legend position inside the plot (e.g., (0.9, 0.2)) or the character word denoting the legend orientation with respect to the plot (e.g., "bottom", "right" or "left"). |
RD_name |
The name of the column containing the risk differences. |
SE_name |
The name of the column containing the standard errors (SE) for each risk difference. |
CIlow_name |
The name of the column containing the lower bound of the confidence interval (optional). |
CIup_name |
The name of the column containing the upper bound of the confidence interval (optional). |
order_legend |
Set to |
t_int_sel |
The subset of time-point indices for which survival should be plotted. |
ymin |
The minimum value of the y axis. The default ( |
ymax |
The maximum value of the y axis. The default ( |
facet |
Set to |
font_size |
Font size for facet labels, legend text and legend title. |
line_RD_plot |
Connect the point risk differences with a plotted line (using |
x_breaks |
Vector of breaks to display on x-axis |
axis_font_size |
Control the font size of x and y axis, leave as NULL for default. |
x_axis_font_angle |
Control the angle of rotation for x-axis labels (default is 0). |
... |
Additional arguments (not used). |
An object of class ggplot
Original R code by Edwin Thoen edwinthoen@gmail.com, modified by Oleg Sofrygin oleg.sofrygin@gmail.com
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.