plot-methods {rstpm2}R Documentation

plots for an stpm2 fit

Description

Given an stpm2 fit, return a plot

Usage


    ## S4 method for signature 'stpm2'
plot(x,y,newdata,type="surv",
                      xlab="Time",line.col=1,ci.col="grey",
                      add=FALSE,ci=TRUE,rug=TRUE,
                      var=NULL,exposed=NULL,times=NULL,...)
    ## S4 method for signature 'pstpm2'
plot(x,y,newdata,type="surv",
                      xlab="Time",line.col=1,ci.col="grey",
                      add=FALSE,ci=TRUE,rug=TRUE,
                      var=NULL,exposed=NULL,times=NULL,...)

Arguments

x

an stpm2 object

y

not used (for generic compatibility)

newdata

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

type

specify the type of prediction

xlab

x-axis label

line.col

line colour

ci.col

confidence interval colour

ci

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

add

whether to add to the current plot (add=TRUE) or make a new plot (add=FALSE) (default=FALSE)

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 (except for cure models, where it defaults to the last event time).

times

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

...

additional arguments (add to the plot command)

Methods

x = "stpm2", y = "missing"

an stpm2 fit

See Also

stpm2


[Package rstpm2 version 1.6.3 Index]