README.md

survextras

Lifecycle:
experimental

The goal of survextras is to provide helper functions for survival analysis.

Installation

You can install the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("alberto-mateos-mo/survextras")

The package contains 3 main functions:

Example

intro_surv() function will give you an introductory plot of your survival data:

library(survextras)
library(survival)

intro_surv(df = cancer, times = "time", event = "status", interactive = FALSE)
#> Loading required package: manipulate
#> Loading required package: dplyr
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union
#> Loading required package: ggplot2

max_diff_time() function finds and plots maximun difference time fitted survival curves.

library(survextras)
library(survival)
library(survminer)
#> Loading required package: ggpubr
#> Loading required package: magrittr

fit <- surv_fit(Surv(time, status)~sex, data = cancer)
max_diff_time(fit)
#> Loading required package: grid

parametric_diagnose() function creates assesment plot to diagnose if KM estimator could potentially follow a known distribution.

library(survextras)
library(survival)
library(survminer)

kmfit <- surv_fit(Surv(time, status)~1, data = cancer)
parametric_diagnose(kmfit)
#> Loading required package: scales



alberto-mateos-mo/survextras documentation built on Feb. 3, 2020, 12:03 a.m.