Skip to contents

Relative survival analysis compares observed survival in a patient cohort to expected survival in a matched general population. Essential for cancer registry studies and population-based research.

Usage

relativesurvival(
  data,
  time,
  status,
  age,
  sex,
  year,
  covariates,
  ratetable = "us",
  method = "poharperme",
  time_scale = "years",
  net_survival = TRUE,
  excess_mortality = TRUE,
  crude_probability = TRUE,
  age_standardized = FALSE,
  period_analysis = FALSE,
  cohort_year = "",
  regression_model = "none",
  spline_df = 4,
  plot_observed = TRUE,
  plot_expected = TRUE,
  plot_relative = TRUE,
  plot_excess = TRUE,
  confidence_level = 0.95,
  timepoints = "1,3,5,10"
)

Arguments

data

The data as a data frame.

time

Follow-up time variable

status

Event status variable

age

Age variable for rate table matching

sex

Sex variable for rate table matching

year

Calendar year for rate table matching

covariates

Covariates for regression models

ratetable

Population rate table for expected survival

method

Relative survival estimation method

time_scale

Time unit specification

net_survival

Compute net survival estimates

excess_mortality

Compute excess mortality

crude_probability

Compute cause-specific crude probabilities

age_standardized

Perform age standardization

period_analysis

Use period analysis approach

cohort_year

Cohort year specification

regression_model

Regression model specification

spline_df

Spline complexity

plot_observed

Show observed survival

plot_expected

Show expected survival

plot_relative

Show relative survival

plot_excess

Show excess hazard

confidence_level

CI level

timepoints

Specific time points

Value

A results object containing:

results$todoa html
results$summarya html
results$survivalTablea table
results$netSurvivalTablea table
results$excessMortalityTablea table
results$crudeProbTablea table
results$regressionTablea table
results$observedPlotan image
results$expectedPlotan image
results$relativePlotan image
results$excessPlotan image
results$ageStandardizedTablea table
results$periodAnalysisTablea table
results$modelFita table
results$interpretationa html

Tables can be converted to data frames with asDF or as.data.frame. For example:

results$survivalTable$asDF

as.data.frame(results$survivalTable)

Examples

# \donttest{
# Example: Cancer relative survival
relativesurvival(
    data = cancer_registry,
    time = followup_years,
    status = vital_status,
    age = age_at_diagnosis,
    sex = gender,
    year = diagnosis_year,
    ratetable = "us_population"
)
# }