tidysurv.formula: Make a tidy survfit object from a formula

Description Usage Arguments Value

Description

Make a tidy survfit object from a formula

Usage

1
2
3
## S3 method for class 'formula'
tidysurv(object, data, na.action = na.exclude,
  time_period = NULL, max_num_levels = 200, ...)

Arguments

object

A formula, as would be specified for survival::survfit.formula

data

A dataframe

na.action

a missing-data filter function

time_period

You can choose to bin events into time-periods. This can be helpful if you want plot the rate within a time-bin, rather than the cumulative rate of incidence.

max_num_levels

Since this function creates a separate survival-curve for each distinct level of predictors (the right hand side of the formula), it can sometimes be the case that you'll accidentally create hundreds or thousands of distinct survival curves, because you accidentally passed the wrong column-name to the formula. This argument ensures that you don't accidentally eat up time computing these curves when you didnt mean to. Default is 200.

...

Further arguments to be passed to survival::survfit.formula

Value

A tidy dataframe


jwdink/tidysurv documentation built on May 20, 2019, 6:24 a.m.