ggkm: Kaplan Meier Plot from Matt Cooper...

Description Usage Arguments Author(s)

View source: R/graphics.R

Description

Kaplan Meier Plot from Matt Cooper (http://mcfromnz.wordpress.com/2012/05/05/kaplan-meier-survival-plot-with-at-risk-table-by-sub-groups/)

Usage

1
2
3
4
5
ggkm(sfit, sdiff = NULL, table = TRUE, returns = FALSE, plot = T,
  color = TRUE, xlabs = "Time", ylabs = "Survival Probability",
  xlims = c(0, max(sfit$time)), ylims = c(0, 1), ystratalabs = NULL,
  ystrataname = NULL, timeby = 100, main = "Kaplan-Meier Plot",
  pval = TRUE, pval.size = 4, probs = NULL, subs = NULL, ...)

Arguments

sfit

a survfit object

sdiff

a survdiff object, used for compuation of exact p-values. If no survdiff object is given computation of p-values is based on the survfit object

table

logical: Create a table graphic below the K-M plot, indicating at-risk numbers?

returns

logical: if TRUE, return an arrangeGrob object

plot

logical: if TRUE, plot the graph

color

logical: if TRUE, use a colored scheme, otherwise black & white

xlabs

x-axis label

ylabs

y-axis label

xlims

the limit of x axis

ylims

the limit on the y axis

ystratalabs

The strata labels. Default = levels(summary(sfit)$strata)

ystrataname

The legend name. Default = "Strata"

timeby

numeric: control the granularity along the time-axis

main

plot title

pval

logical: add the pvalue to the plot?

pval.size

size of the pvalue in the plot. Default to 3

probs

numeric: vector with survail probabilities that will be marked by dotted lines, dfault to NULL

subs

default to NULL

Author(s)

Matt Cooper http://statbandit.wordpress.com/2011/03/08/an-enhanced-kaplan-meier-plot/


sagade/inf460 documentation built on Dec. 31, 2020, 3:15 a.m.