fit_data: Fitting right censored survival data to distribution

Description Usage Arguments See Also Examples

View source: R/fit_data.R

Description

Fits right censored data to a distribution using maximum likelihood estimates.

Usage

1
fit_data(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 a 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, the function returns a list. The list will be in alphabetic order of the values in the by column. Variable can contain logical, string, character, or numeric data.

See Also

fitdistcens

Examples

1
2
3
4
data("rearrest")
fit_data(rearrest, "lnorm", time = "months")

fit_data(rearrest, "weibull", time = "months", by = "personal")

parmsurvfit documentation built on May 2, 2019, 5:41 a.m.