plot_surv {parmsurvfit}R Documentation

Plotting parametric survival curves

Description

Plots survival curve of right censored data given that it follows a specified parametric distribution.

Usage

plot_surv(data, dist, time = "time", censor = "censor", by = "")

Arguments

data

A dataframe containing a time column and a censor column.

dist

A string name for a distribution that has a corresponding density function and distribution function. Examples include "norm", "lnorm", "exp", "weibull", "logis", "llogis", "gompertz", etc.

time

The string name of the time column of the dataframe. Defaults to "time".

censor

The string name of the censor column of the dataframe. Defaults to "censor". The censor column must be a numeric indicator variable where complete times correspond to a value of 1 and incomplete times correspond to 0.

by

The string name of a grouping variable. If specified, multiple lines will be plotted. Variable can contain logical, string, character, or numeric data.

Examples

data("rearrest")
plot_surv(rearrest, "lnorm", time = "months")
plot_surv(rearrest, "weibull", time = "months", by = "personal")

[Package parmsurvfit version 0.1.0 Index]