surv_curv: multiple survival curves

Description Usage Arguments Value Examples

View source: R/surv-curv.R

Description

create multiple survival curves for multiple endpoints, stratifications and groupings

Usage

1
2
3
surv_curv(data, surv, strata = NULL, glist = NULL, w = NULL,
  prefix = c(event = "ev.", time = "t."), progress = FALSE,
  stringsAsFactors = TRUE)

Arguments

data

the data

surv

the Surv objects (as character, refering to variables in 'data') OR the common names of time + event, if these have similar names (differing only in perfix)

strata

stratifying variable

glist

a grouping list, or the name of a grouping variable in 'data'

w

weight or name of variable that provides weights

prefix

prefix values for times and events

progress

primitive displayer of progress

stringsAsFactors

logical, if TRUE will keep ordering of ingoing stuff

Value

A tbl_df with an rbinded broom::tidy'd survival::survfited version of all the combinations of 'strata' and 'glist' for each 'surv'. That is a crap explanation...

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
n = 1200
df <- data.frame(
        t.foo = abs(rnorm(n, 10, 2)),
        ev.foo = rbinom(n, 1, 0.2),
        t.bar = abs(rnorm(n, 10, 3)),
        ev.bar = rbinom(n, 1, 0.3),
        strutt = sample(letters[1:2], n, TRUE),
        gsak = sample(LETTERS[4:7], n, TRUE),
        wait = .5 + abs(rnorm(n, 0, 1))
)
surv_curv(data = df, surv = c("foo", "bar"), w = "wait",
          strata = "strutt", glist = "gsak")

renlund/miscmatch documentation built on March 19, 2018, 10:09 a.m.