Type: Package
Title: Relative Survival, AER and SMR Based on French Death Rates
Version: 1.2
Date: 2025-03-26
Maintainer: Hugo Varet <varethugo@gmail.com>
Depends: R (≥ 3.5.0), survival
Imports: WriteXLS, stats, graphics
Encoding: UTF-8
LazyData: Yes
Description: It computes Relative survival, AER and SMR based on French death rates.
License: GPL-2 | GPL-3 [expanded from: GPL (≥ 2)]
RoxygenNote: 7.3.2
NeedsCompilation: no
Packaged: 2025-03-26 11:03:15 UTC; hvaret
Author: Hugo Varet [aut, cre], Jean-Philippe Jais [aut]
Repository: CRAN
Date/Publication: 2025-03-26 12:00:02 UTC

Relative survival, AER and SMR based on French death rates

Description

Relative survival, AER and SMR based on French death rates

Author(s)

Jean-Philippe Jais and Hugo Varet


Absolute Excess Risk (AER)

Description

Computes the AER, its confidence interval and its associated p-value

Usage

AER(
  futime,
  status,
  age,
  sex,
  entry_date,
  PY.stand = 10000,
  ratetable = survexp.fr::survexp.fr,
  alpha = 0.05
)

Arguments

futime

follow-up time of the subjects in days

status

0 if censored or 1 if dead at futime

age

age in days

sex

"male" or "female"

entry_date

entry date in the study

PY.stand

value to get the AER for stand person-years

ratetable

a table of event rates, such as survexp.fr or survexp.us

alpha

determines the confidence level (1-alpha) of the confidence interval

Details

The Absolute Excess Risk (AER) is defined as:

AER = O-E

where O is the observed number of deaths and E is the expected number based on the patients'characteristics (sex, age and entry date in the study). This function uses an additive Poisson model to compute the AER.

Value

A list containing the AER with the corresponding number of person-years (PY.stand argument), its confidence interval, its p-value, the observed number of deaths, the expected number of deaths and the observed number of person-years

Author(s)

Jean-Philippe Jais and Hugo Varet

References

N. Breslow and N. Day, Statistical methods in cancer research, Volume II - The design and analysis of cohort studies, World Health Organization, 1987

P. Dickman, A. Sloggett, M. Hills and T. Hakulinen, Regression models for relative survival, Statistics in Medicine, 2004

C. Elie, Y. De Rycke, J.-P. Jais and P. Landais, Appraising relative and excess mortality in population-based studies of chronic diseases such as end-stage renal disease, Clinical Epidemiology, 2011

Examples

attach(data.example)
AER(futime, status, age, sex, entry_date)

Log-Rank test between an observed and an expected survival curve

Description

Log-Rank test between an observed and an expected survival curve

Usage

LR(futime, status, age, sex, entry_date, ratetable = survexp.fr::survexp.fr)

Arguments

futime

follow-up time of the subjects in days

status

0 if censored or 1 if dead at futime

age

age in days

sex

"male" or "female"

entry_date

entry date in the study

ratetable

a table of event rates, such as survexp.fr or survexp.us

Details

The Log-Rank is calculated as:

LR = (O-E)^2/E

where O is the observed number of deaths and E is the expected number based on the patients' characteristics (sex, age and entry date in the study). It follows a Khi-2 distribution with one degree of freedom, which allows to compute its p-value.

Value

A list containing the observed number of deaths, the expected number of deaths, the Log-Rank statistic and its p-value

Author(s)

Hugo Varet

References

R. Peto and J. Peto, Asymptotically Efficient Rank Invariant Test Procedures, Journal of the Royal Statistical Society, 1972

Examples

attach(data.example)
LR(futime, status, age, sex, entry_date)

Standardized Mortality Ratio (SMR)

Description

Computes the SMR, its confidence interval and its associated p-value

Usage

SMR(
  futime,
  status,
  age,
  sex,
  entry_date,
  ratetable = survexp.fr::survexp.fr,
  alpha = 0.05
)

Arguments

futime

follow-up time of the subjects in days

status

0 if censored or 1 if dead at futime

age

age in days

sex

"male" or "female"

entry_date

entry date in the study

ratetable

a table of event rates, such as survexp.fr or survexp.us

alpha

determines the confidence level (1-alpha) of the confidence interval

Details

The SMR is estimated using two different methods.

The classic method is:

SMR = O/E

where O is the observed number of deaths and E is the expected number based on the patients' characteristics (sex, age and entry date in the study).

The SMR is also estimated performing a Poisson model where O is the dependant variable and E is an offset.

Value

A list containing the observed number of deaths, the expected number of deaths, the "classic" SMR (with its confidence interval and its p-value) and the SMR calculated by a Poisson model (with its confidence interval and its p-value)

Author(s)

Jean-Philippe Jais and Hugo Varet

References

N. Breslow and N. Day, Statistical methods in cancer research, Volume II - The design and analysis of cohort studies, World Health Organization, 1987

Examples

attach(data.example)
SMR(futime, status, age, sex, entry_date)

Example data to illustrate the functions

Description

Example data to illustrate the functions

Format

A data frame with 200 observations on the following 5 variables.

sex

"male" or "female"

age

age in days

entry_date

entry date in the study

status

status at follow-up time: 0 if alive, 1 if dead

futime

follow-up time in days


French data for the expected survival and person years functions

Description

French data for the expected survival and person years functions

Details

Death rates are available from 1977 to 2022 for males and females aged from 0 to 99

Source

https://www.ined.fr/fichier/s_rubrique/193/fr_t68_2022.fr.xlsx

References

Institut national d'études démographiques


Observed Kaplan-Meier, expected and relative survival curves

Description

Displays the observed Kaplan-Meier, expected and relative survival curves

Usage

survexp_plot(
  futime,
  status,
  age,
  sex,
  entry_date,
  ratetable = survexp.fr::survexp.fr,
  main = "Observed and expected survival",
  xlab = "Time (years)",
  ylab = "Survival",
  col.km = "black",
  lwd.km = 2,
  lty.km = 1,
  conf.int.km = TRUE,
  col.exp = "blue",
  lwd.exp = 2,
  lty.exp = 1,
  main.rel = "Relative survival",
  ylab.rel = "Relative survival",
  col.rel = "black",
  lwd.rel = 2,
  lty.rel = 1,
  times = seq(0, max(futime, na.rm = TRUE)/365.241, length = 6)[-1],
  alpha = 0.05,
  xscale = 365.241,
  ...
)

Arguments

futime

follow-up time of the subjects in days

status

0 if censored or 1 if dead at futime

age

age in days

sex

"male" or "female"

entry_date

entry date in the study

ratetable

a table of event rates, such as survexp.fr or survexp.us

main

main title of the Kaplan-Meier and expected survivals plot

xlab

x-label of the plot

ylab

y-label of the plot

col.km

color of the observed survival curve

lwd.km

line width of the observed survival curve

lty.km

line type of the observed survival curve

conf.int.km

TRUE to display the confidence interval of the observed survival

col.exp

color of the expected survival curve

lwd.exp

line width of the expected survival curve

lty.exp

line type of the expected survival curve

main.rel

main title of the relative survival plot

ylab.rel

y-label of the relative survival plot

col.rel

color of the relative survival curve

lwd.rel

line width of the relative survival curve

lty.rel

line type of the relative survival curve

times

times to draw the confidence intervals of the relative survival

alpha

determines the confidence level (1-alpha) of the confidence intervals for the relative survival

xscale

see the xscale argument in plot.survfit

...

other arguments to be passed in plot.survfit

Details

This function displays the observed and expected survivals, and the relative survival which is defined as:

r(t) = exp(-exp(\beta) \times t)

where exp(\beta) is the excess risk by time unit estimated by an additive Poisson model.

Value

A matrix containing the values of relative survivals and their confidence intervals for each time of times

Author(s)

Hugo Varet

References

M. Pohar and J. Stare, Making relative survival analysis relatively easy, Computers in Biology and Medicine, 2007

M. Pohar and J. Stare, Relative survival analysis in R, Computers Methods and Programs in Biomedicine, 2006

Examples

attach(data.example)
survexp_plot(futime, status, age, sex, entry_date)