surv_uni_cat: Modify the Survival Output for a Categorical Variable.

View source: R/surv_uni_cat.R

surv_uni_catR Documentation

Modify the Survival Output for a Categorical Variable.

Description

This function generates a table with the general survival analysis results, including the number of total patients, the number of sevents, the estimated median, the 1,2,5 year rate, the HR (95 percent confidence interval), the P value, the AIC, and the C index. This function just modifies the output table's format.

Usage

surv_uni_cat(
  dat,
  stime,
  sevent,
  svar,
  month = 0,
  medianCI = TRUE,
  y1 = TRUE,
  y2 = TRUE,
  y5 = TRUE,
  report_index = FALSE
)

Arguments

dat

a data.frame.

stime

the duration of follow-up time in months.

sevent

the status indicator, which is generally 0 = alive, 1 = dead.

svar

a variable name.

month

a number to get the month-rate of survival.

medianCI

logical value indicating whether the 95 percent confidence interval of projected median survival should be reported.

y1

logical value indicating whether the 1-year survival rate should be reported.

y2

logical value indicating whether the 2-year survival rate should be reported.

y5

logical value indicating whether the 5-year survival rate should be reported.

report_index

logical value indicating if to report the show AIC and C index.

Value

a tibble of survival output

Examples

Dat <- survival::lung
surv_uni_cat(Dat, "time", "status", "sex", report_index = TRUE)

SophiaJia/Survout documentation built on Oct. 1, 2022, 9:52 p.m.