plotEffects: Plotting time-varying effects from a risk regression model.

Description Usage Arguments Author(s) Examples

View source: R/plotEffects.R

Description

Plot time-varying effects from a risk regression model.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
plotEffects(
  x,
  formula,
  level,
  ref.line = TRUE,
  conf.int = 0.95,
  xlim,
  ylim,
  xlab = "Time",
  ylab = "Cumulative coefficient",
  col,
  lty,
  lwd,
  add = FALSE,
  legend,
  axes = TRUE,
  ...
)

Arguments

x

Fitted object obtained with one of ARR, LRR, riskRegression.

formula

A formula to specify the variable(s) whose regression coefficients should be plotted.

level

For categorical variables the level (group) whose contrast to the reference level (group) should be plotted.

ref.line

Logical. If TRUE then add a horizontal line at zero.

conf.int

Logical. If TRUE then add confidence limits. Can be controlled using smart arguments. See examples

xlim

See plot

ylim

See plot

xlab

See plot

ylab

See plot

col

A vector of colors for the regression coefficients.

lty

A vector of line types for the regression coefficients.

lwd

A vector of line thicknesses for the regression coefficients.

add

Logical. If TRUE then add lines to an existing plot.

legend

Logical. If TRUE then add a legend. Can be controlled using smart arguments. See examples.

axes

Logical. If FALSE then do not draw axes.

...

Used for transclusion of smart arguments for plot, axis. See function SmartControl from prodlim.

Author(s)

Thomas H. Scheike ts@biostat.ku.dk

Thomas A. Gerds tag@biostat.ku.dk

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
library(survival)
library(prodlim)
data(Melanoma)

fit.tarr <- ARR(Hist(time,status)~strata(sex),
                data=Melanoma,
                cause=1)
plotEffects(fit.tarr)

fit.tarr <- ARR(Hist(time,status)~strata(sex)+strata(invasion),
                data=Melanoma,
                cause=1,
                times=seq(800,3000,20))
plotEffects(fit.tarr,formula=~sex)
plotEffects(fit.tarr,formula=~invasion)
plotEffects(fit.tarr,
            formula=~invasion,
            level="invasionlevel.1")

## legend arguments are transcluded:
plotEffects(fit.tarr,
            formula=~invasion,
            legend.bty="b",
            legend.cex=1)

## and other smart arguments too:
plotEffects(fit.tarr,
	    formula=~invasion,
	    legend.bty="b",
axis2.las=2,
	    legend.cex=1)

riskRegression documentation built on Jan. 13, 2021, 11:12 a.m.