iwillsurvive: Create an iwillsurvive object

View source: R/iwillsurvive.R

iwillsurviveR Documentation

Create an iwillsurvive object

Description

Create an iwillsurvive object

Usage

iwillsurvive(
  data,
  followup_time = "followup_months",
  event_status = "event_status",
  patient_id = "patientid",
  terms = NULL,
  type = "right",
  fit = NULL,
  event_title = "<event>",
  index_title = "<index>",
  title = NULL,
  followup_time_units = NULL,
  verbose = TRUE
)

Arguments

data

dataframe. A one-row-per-patient dataframe

followup_time

character. The column representing followup time.

event_status

character. The column representing event status – must be logical.

patient_id

character. ... uniquep patientid.

terms

character. A vector of model terms.

type

character. See ?survival::survfit.formula

fit

survfit. An optional survfit object created from survival:survfit(). If specified, no additional model(s) will be fit.

event_title

character. An optional name of

index_title

character.

title

character. An optional title of the analysis that is passed to print() and plot() methods.

followup_time_units

character. Units used in followup time

verbose

logical. If TRUE, return messages

Value

survfit. See ?survival::survfit.object to learn more

Examples


cohort_survival

# No Terms

cohort_fit <- iwillsurvive(cohort_survival,
  followup_time = "followup_days"
)
cohort_fit

# Now including a term

cohort_fit <- iwillsurvive(cohort_survival,
  followup_time = "followup_days",
  terms = "condition"
)
cohort_fit

ndphillips/iwillsurvive documentation built on June 4, 2024, 3 p.m.