Learn R Programming

survutils (version 1.0.2)

get_nrisk_tbl: Returns a Number At Risk Table from a survfit Object

Description

This function generates a number at risk table that typically seen in publications.

Usage

get_nrisk_tbl(sfit, timeby)

Arguments

sfit

A survival::survfit object.

timeby

The "step" in which to calculate the risk.

Value

A data.frame with the number of risks at each timeby step.

Examples

Run this code
# NOT RUN {
fit <- survival::survfit(survival::Surv(time,status) ~ rx, data = survival::colon)
get_nrisk_tbl(fit, timeby = 500)
# }

Run the code above in your browser using DataLab