landmark: Landmark

landmarkR Documentation

Landmark

Description

Fit survival curves for landmark time points.

Usage

landmark(
  object,
  times = NULL,
  col = 2L,
  plot = TRUE,
  plot.main = plot,
  lr_test = TRUE,
  adjust_start = FALSE,
  single = FALSE,
  ...
)

Arguments

object

an object of class survfit

times

a vector of landmark times

col

color for times annotations; use col = 0 to suppress labels

plot, plot.main

logicals; if TRUE, landmark and s are plotted, respectively

lr_test

logical or numeric; if TRUE, a log-rank test will be performed and the results added to the top-right corner of the plot; if numeric, the value is passed as rho controlling the type of test performed; see survdiff

adjust_start

logical; if TRUE, each landmark plot will begin at the y-axis

single

logical; if TRUE, plots drawn on a single frame

...

additional arguments passed to kmplot

Value

A list with the following elements:

$table

data frame with the sample size, chi-square statistic, degrees of freedom, and p-value for the test (the type of test can be controlled by using a numeric value for lr_test, passed as rho to survdiff)

$survfit

a list with each survfit object

Examples

library('survival')
s <- survfit(Surv(time, status) ~ rx, colon)
l <- landmark(s, times = c(500, 1000, 2000), single = TRUE)
l$table

layout(matrix(c(1, 1, 2, 3), 2))
landmark(s, times = c(500, 2000), adjust_start = TRUE,
         hr_text = TRUE, col.surv = 4:6)


raredd/rawr documentation built on March 4, 2024, 1:36 a.m.