survfit_fast: Create lifetable quickly

survfit_fastR Documentation

Create lifetable quickly

Description

Simple, fast function to generate basic lifetables. No error checking is performed.

Usage

survfit_fast(time, events)

Arguments

time

Vector of event/censoring times

events

Vector of indicators for whether each time is an event (1) or a censoring (0). Must be same length vector as time argument.

Value

Returns a list format lifetable with the following entries:

  • "n"Number of patients

  • "time"Vector of times

  • "n.risk"Vector of numbers of patients at risk at each time

  • "n.event"Vector of numbers of patients with an event at each time

  • "n.censor"Vector of numbers of patients censored at each time

  • "surv"Vector of estimates of Survival function at each time

  • "se"Vector of standard errors of estimates of Survival function at each time

Author(s)

James Bell

Examples

survfit_fast(c(1,2,3,3,4,5),c(1,0,1,1,0,1))

gestate documentation built on April 26, 2023, 5:10 p.m.