km: Plots an 'enhanced' Kaplan-Meier plot, with base graphics...

Description Usage Arguments Value

View source: R/km.R

Description

This function plots a Kaplan-Meier plot.

Usage

1
2
3
4
5
km(time = NULL, status = NULL, strata = NULL, time.unit = c("days",
  "weeks", "months", "years"), time.by = NULL, main = "", ylab = NULL,
  xlab = NULL, xlim = NULL, ylim = c(0, 1), reverse = FALSE,
  conf.int = NULL, test = c("logr", "hr", "both", "no"),
  plot.n.at.risk = TRUE, gr.legend = NULL, ...)

Arguments

time

survival time variable

status

survival indicator variable

strata

Stratifying variable (optional)

time.unit

Time unit of x axis

time.by

Time step x axis (in days)

main

Graph main title

ylab

Y-axis label.

xlab

X-axis label. If NULL a suitable default based on time.unit will be provided

xlim

X-axis limit. If NULL a suitable default based on time.unit will be provided

ylim

Y-axis limit. Default to c(0,1) be provided

reverse

plot cumulative events

conf.int

logical ... Plot confidence intervall? If NULL confidence interval are plotted only if strata has two or more levels

test

tests: 'no'=don't plot tests, 'logr'=logranktest, 'hr'=hazratio, 'both'=both

plot.n.at.risk

Logical value: plot number at risk?

gr.legend

Graph command to add legend, as string

...

Further lines.survfit parameters

Value

The function plot the graph and return a list with Laplan-Meier statistics


lbraglia/yapomif documentation built on May 20, 2019, 11:26 p.m.