plot.cpsurv: Plot method for objects of class cpsurv

Description Usage Arguments Details See Also Examples

View source: R/methods.R

Description

Plot method for objects of class 'cpsurv' inheriting from a call to cpsurv.

Usage

1
2
3
4
5
## S3 method for class 'cpsurv'
plot(x, type = "all", ci = TRUE, ci.type = c("perc",
  "norm"), const.haz = TRUE, regline = TRUE, legend = TRUE, xlim = NULL,
  ylim = NULL, main = NULL, xlab = NULL, ylab = NULL, min.time,
  max.time, n.est.grid = 101, ask = TRUE, ...)

Arguments

x

An object of class 'cpsurv' (estimated with cpsurv).

type

A vector of character strings to select the plots for printing. The value should be any subset of the values c("pvals", "events", "hazard") or simply "all", where all possible plots are shown.

ci

Logical; if TRUE, a bootstrap confidence interval is plotted (if existing).

ci.type

Character representing the type of confidence interval to plot (if existing); "perc" for percentile interval and "norm" for CI with normal approximation (default is "perc").

const.haz

Logical; if TRUE, the estimated constant hazardrate is plotted.

regline

Logical; if TRUE, the regression line is plotted.

legend

Logical; if TRUE, the plots contain legends.

xlim

Vector with x limits (timeline) for each plot if supplied; default is c(0, x$cpmax).

ylim

Vector with y limits for plots of type "events" and "hazard". For changing ylim for only one of them, plot them separately by use of argument 'type'.

main

Main title for each plot if supplied.

xlab

Character vector used as x label for all plots if supplied.

ylab

Character vector used as y label for all plots if supplied.

min.time

Left bound of time domain used for muhaz. If missing, min.time is considered 0.

max.time

Right bound of time domain used for muhaz. If missing, value 'cpmax' of object x is used.

n.est.grid

Number of points in the estimation grid, where hazard estimates are computed (used for muhaz). Default value is 101.

ask

If TRUE, the user is asked for input, before a new figure is drawn.

...

Additional arguments passed through to plotting functions.

Details

The value type = "pvals" produces a plot with p-values used to estimate the stump regression model with superimposed least squares regression line. For type = "events" a barplot is produced with frequency of events per unit at risk for each interval (with length intwd. For type = "hazard" the estimated hazard rate (based on muhaz) is plotted with optional (normal- or percentile-) confidence intervals and the estimated constant hazard rate.

See Also

muhaz

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(survdata)
cp <- cpsurv(survdata$time, survdata$event, cpmax = 360, intwd = 10)
plot(cp, ask = FALSE)

## Not run: 
cp <- cpsurv(survdata$time, survdata$event, cpmax = 360, intwd = 10,
boot.ci = TRUE)
plot(cp, type = "pvals", ask = FALSE)

## End(Not run)

stefkruegel/CPsurv documentation built on May 26, 2019, 4:35 a.m.