draw.kaplan: draw.kaplan

Description Usage Arguments Value Examples

Description

Mega function that draws multiple kaplan meyer survival curves (or just 1)

Usage

1
2
3
4
draw.kaplan(chosen.btas, xdata, ydata, probs = c(0.5, 0.5),
  filename = "SurvivalCurves", save.plot = F, xlim = NULL, ylim = NULL,
  expand.yzero = F, base.directory = file.path("output", "kaplan-meier"),
  legend.outside = T)

Arguments

chosen.btas

list of testing coefficients to calculate prognostic indexes, for example “list(Age = some_vector)“

xdata

n x m matrix with n observations and m variables

ydata

Survival object

probs

How to separate high and low risk patients 50%-50% is the default, but for top and bottom 40% -> c(.4,.6)

filename

Name of file if save.plot is TRUE

save.plot

TRUE plots everything and save, FALSE only calculates p-valeu

xlim

Optional argument to limit the x-axis view

ylim

Optional argument to limit the y-axis view

base.directory

Initial directory where to store files

legend.outside

If TRUE legend will be outside plot, otherwise inside

Value

A list with plot, p-value and kaplan-meier object

Examples

1
2
3
data('ovarian', package = 'survival')
draw.kaplan(c(age = 1), ovarian$age, data.frame(time = ovarian$futime, status = ovarian$fustat))
draw.kaplan(c(age = 1), c(1,0,1,0,1,0), data.frame(time = runif(6), status = rbinom(6, 1, .5)))

averissimo/verissimo-rpackage documentation built on May 11, 2019, 4:07 p.m.