Given the results from LocalControl with outcomeType = "survival", plot a corrected and uncorrected cumulative incidence function (CIF) for both groups.
# S3 method for LocalControlCR
plot(
x,
...,
rad2plot,
xlim,
ylim = c(0, 1),
col1 = "blue",
col0 = "red",
xlab = "Time",
ylab = "Cumulative incidence",
legendLocation = "topleft",
main = "",
group1 = "Treatment 1",
group0 = "Treatment 0"
)Return object from LocalControl with outcomeType = "survival".
Arguments passed on to graphics::plot.default
type1-character string giving the type of plot desired. The
following values are possible, for details, see plot:
"p" for points, "l" for lines,
"b" for both points and lines,
"c" for empty points joined by lines,
"o" for overplotted points and lines,
"s" and "S" for stair steps and
"h" for histogram-like vertical lines. Finally,
"n" does not produce any points or lines.
loga character string which contains "x" if the x axis
is to be logarithmic, "y" if the y axis is to be logarithmic
and "xy" or "yx" if both axes are to be logarithmic.
suba subtitle for the plot.
anna logical value indicating whether the default annotation (title and x and y axis labels) should appear on the plot.
axesa logical value indicating whether both axes should be drawn on
the plot. Use graphical parameter "xaxt" or "yaxt"
to suppress just one of the axes.
frame.plota logical indicating whether a box should be drawn around the plot.
panel.firstan ‘expression’ to be evaluated after the
plot axes are set up but before any plotting takes place. This can
be useful for drawing background grids or scatterplot smooths. Note
that this works by lazy evaluation: passing this argument from other
plot methods may well not work since it may be evaluated too
early.
panel.lastan expression to be evaluated after plotting has
taken place but before the axes, title and box are added. See the
comments about panel.first.
aspthe \(y/x\) aspect ratio, see plot.window.
xgap.axis,ygap.axisthe \(x/y\) axis gap factors, passed as
gap.axis to the two axis() calls (when
axes is true, as per default).
The index or name ("rad_#") of the radius to plot. By default, the radius with pct_informative closest to 0.8 will be selected.
The x axis bounds. Defaults to c(0, max(lccrResults$Failtimes)).
The y axis bounds. Defaults to c(0,1).
The plot color for group 1.
The plot color for group 0.
The x axis label. Defaults to "Time".
The y axis label. Defaults to "Cumulative incidence".
The location to place the legend. Default "topleft".
The main plot title. Default is empty.
The name of the primary group (Treatment 1).
The name of the secondary group (Treatment 0).
Lauve NR, Nelson SJ, Young SS, Obenchain RL, Lambert CG. LocalControl: An R Package for Comparative Safety and Effectiveness Research. Journal of Statistical Software. 2020. p. 1-32. Available from: http://dx.doi.org/10.18637/jss.v096.i04
data("cardSim")
results = LocalControl(data = cardSim,
outcomeType = "survival",
outcomeColName = "status",
timeColName = "time",
treatmentColName = "drug",
treatmentCode = 1,
clusterVars = c("age", "bmi"))
plot(results)
Run the code above in your browser using DataLab