ggplot_sieve | R Documentation |
ggplot
ggplot
-style plotting for univariate marks. Point and interval estimates of the mark-specific treatment effect parameter specified by component contrast
in summary.sievePH
are plotted, together with scatter and box plots of the observed mark values by treatment.
ggplot_sieve( x, mark = NULL, tx = NULL, xlim = NULL, ylim = NULL, xtickAt = NULL, xtickLab = NULL, ytickAt = NULL, ytickLab = NULL, tickLabSize = 14, xlab = NULL, ylab = NULL, axisLabSize = 15, title = NULL, titleSize = 16, subtitle = NULL, subtitleSize = 10, txLab = c("Placebo", "Treatment"), txLabSize = 5, legendLabSize = 12, legendPosition = c(0.96, 1.08), legendJustification = c(1, 1), estLineSize = 1.6, ciLineSize = 1.2, boxplotWidth = 0.8, jitterFactor = 0.1, jitterSeed = 0, pointColor = c("blue", "red3"), pointSize = 1.7, bottomPlotMargin = c(-0.5, 0.3, 0, 0), topPlotMargin = c(0, 0.3, -0.12, 1.83), plotHeights = c(0.33, 0.67) )
x |
an object returned by |
mark |
a numeric vector specifying a univariate continuous mark. For subjects with a right-censored time-to-event, the value(s) in |
tx |
a numeric vector indicating the treatment group (1 if treatment, 0 if placebo) |
xlim |
a numeric vector of length 2 specifying the x-axis range ( |
ylim |
a numeric vector of length 2 specifying the y-axis range ( |
xtickAt |
a numeric vector specifying the position of x-axis tickmarks ( |
xtickLab |
a numeric vector specifying labels for tickmarks listed in |
ytickAt |
a numeric vector specifying the position of y-axis tickmarks ( |
ytickLab |
a numeric vector specifying labels for tickmarks listed in |
tickLabSize |
a numeric value specifying the font size of tickmark labels along both axes in the bottom panel ( |
xlab |
a character string specifying the x-axis label ( |
ylab |
a character string specifying the y-axis label ( |
axisLabSize |
a numeric value specifying the font size of both axis labels in the bottom panel ( |
title |
a character string specifying the plot title ( |
titleSize |
a numeric value specifying the font size of the plot title ( |
subtitle |
a character string specifying the plot subtitle ( |
subtitleSize |
a numeric value specifying the font size of the plot subtitle ( |
txLab |
a character vector of length 2 specifying the placebo and treatment labels (in this order). The default labels are |
txLabSize |
a numeric value specifying the font size of labels |
legendLabSize |
a numeric value specifying the font size of legend labels in the bottom panel ( |
legendPosition |
a numeric vector of length 2 specifying the position of the legend in the bottom panel ( |
legendJustification |
a numeric vector of length 2 specifying the justification of the legend in the bottom panel ( |
estLineSize |
a numeric value specifying the line width for the point estimate of the mark-specific treatment effect ( |
ciLineSize |
a numeric value specifying the line width for the confidence limits for the mark-specific treatment effect ( |
boxplotWidth |
a numeric value specifying the width of each box in the box plot ( |
jitterFactor |
a numeric value specifying the amount of vertical jitter ( |
jitterSeed |
a numeric value setting the seed of R's random number generator for jitter in the scatter plot ( |
pointColor |
a character vector of length 2 color-coding the placebo and treatment group (in this order) in the scatter plot ( |
pointSize |
a numeric value specifying the size of data points in the scatter plot ( |
bottomPlotMargin |
a numeric vector, using cm as the unit, passed on to argument |
topPlotMargin |
a numeric vector, using |
plotHeights |
a numeric vector specifying relative heights of the top and bottom panels ( |
A ggplot
object.
plot.summary.sievePH
, sievePH
and summary.sievePH
n <- 500 tx <- rep(0:1, each=n/2) tm <- c(rexp(n/2, 0.2), rexp(n/2, 0.2 * exp(-0.4))) cens <- runif(n, 0, 15) eventTime <- pmin(tm, cens, 3) eventInd <- as.numeric(tm <= pmin(cens, 3)) mark <- ifelse(eventInd==1, c(rbeta(n/2, 2, 5), rbeta(n/2, 2, 2)), NA) markRng <- range(mark, na.rm=TRUE) # fit a model with a univariate mark fit <- sievePH(eventTime, eventInd, mark, tx) sfit <- summary(fit, markGrid=seq(markRng[1], markRng[2], length.out=10)) print(ggplot_sieve(sfit, mark, tx))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.