Learn R Programming

rstpm2 (version 1.4.2)

lines.stpm2: S3 methods for lines

Description

S3 methods for lines

Usage

# S3 method for stpm2
lines(x, newdata = NULL, type = "surv", col = 1, ci.col= "grey",
lty = par("lty"), ci = FALSE, rug = FALSE, var = NULL,
exposed = incrVar(var), times = NULL, ...)
# S3 method for pstpm2
lines(x, newdata = NULL, type = "surv", col = 1,
ci.col= "grey",
lty = par("lty"), ci = FALSE, rug = FALSE, var = NULL,
exposed = incrVar(var), times = NULL, ...)

Arguments

x

an stpm2 object

newdata

required list of new data. This defines the unexposed newdata (excluding the event times).

type

specify the type of prediction

col

line colour

lty

line type

ci.col

confidence interval colour

ci

whether to plot the confidence interval band (default=TRUE)

rug

whether to add a rug plot of the event times to the current plot (default=TRUE)

var

specify the variable name or names for the exposed/unexposed (names are given as characters)

exposed

function that takes newdata and returns the exposed dataset. By default, this increments var

times

specifies the times. By default, this uses a span of the observed times.

additional arguments (add to the plot command)