autoplot.survIDM: Visualization of objects of class 'survIDM' with ggplot2...

Description Usage Arguments Value Author(s) Examples

View source: R/autoplot.survIDM.R

Description

It draws the estimated probabilities.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## S3 method for class 'survIDM'
autoplot(
  object = object,
  y = NULL,
  trans = "all",
  func = "distribution",
  conf = NULL,
  type = NULL,
  conftype = NULL,
  col = 1:6,
  confcol = 1:6,
  lty = 1,
  conflty = 2,
  xlab = "Time",
  ylab = NULL,
  ylim = NULL,
  xlim = NULL,
  interactive = FALSE,
  ...
)

Arguments

object

Object of survIDM class.

y

NULL

trans

The transition probabilities plotted. It is used only when the object is of class "AJ", "LIDA" "LM", "PLM", "LMAJ", "PLMAJ", "PAJ" and "tpIPCW". Possible options are "all" (default), "00", "01", "02", "11" or "12".

func

It is used only when the object is of class "soj" or "sojIPCW". The type of curve to be drawn ("distribution" or "survival"). Default to "distribution".

conf

Draw the confidence intervals into the plot. By default it is NULL, they are drawn if the "surv" object contains them.

type

The type of plot that should be drawn. See details par for possible options. Defaults to "s" for the draw be stair steps.

conftype

The type of plot that should be drawn for confidence intervals. See details par for possible options. Defaults to "s" for the draw be stair steps.

col

Vector of colors. Colors are used cyclically.

confcol

Vector of colors for the confidence intervals. Colors are used cyclically.

lty

The line type. Line types can either be specified as an integer (0 = blank, 1 = solid (default), 2 = dashed, 3 = dotted, 4 = dotdash, 5 = longdash, 6 = twodash). See details in par.

conflty

The line type for confidence intervals. Line types can either be specified as an integer (0 = blank, 1 = solid (default), 2 = dashed, 3 = dotted, 4 = dotdash, 5 = longdash, 6 = twodash).

xlab

A title for the x axis: see title.

ylab

A title for the y axis: see title.

ylim

The y limits of the plot.

xlim

The x limits of the plot.

interactive

Logical flag indicating if an interactive plot with plotly is produced.

...

Other options.

Value

A ggplot object, so you can use common features from ggplot2 package to manipulate the plot.

Author(s)

Luis Meira-Machado, Marta Sestelo and Gustavo Soutinho.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
res <- tprob(survIDM(time1, event1, Stime, event) ~ 1, s = 0,
method = "AJ", conf = FALSE, data = colonIDM)
autoplot(res)
autoplot(res, trans = "02")

  res1 <- tprob(survIDM(time1, event1, Stime, event) ~ factor(sex), s = 365,
                method = "AJ", conf = FALSE, data = colonIDM)

  autoplot(res1, trans="02", ylim=c(0,0.5))


  res2 <- CIF(survIDM(time1, event1, Stime, event) ~ age, data = colonIDM,
              z.value = 56, conf = FALSE)

  autoplot(res2)


  res3 <- sojourn(survIDM(time1, event1, Stime, event) ~ factor(sex),
                  data = colonIDM, conf = FALSE, conf.level = 0.95)

  autoplot(res3)

survidm documentation built on June 25, 2021, 1:07 a.m.