censor_date: Date of censoring

censor_dateR Documentation

Date of censoring

Description

Calculate date of censoring using date of diagnosis and last follow-up.

Usage

censor_date(date_dx, date_lfu, cutoff_yr)

Arguments

date_dx

date of diagnosis

date_lfu

date of last follow-up

cutoff_yr

number of years to cutoff at

Details

The cutoff date is cutoff_yr years after the date of diagnosis, on December 31st. If the cutoff date is earlier than the date of last follow-up, then the cutoff date is the new date of censoring, otherwise use the date of last follow-up.

Value

date of censoring

Author(s)

Derek Chiu

Examples

date_dx <- as.Date("2003-03-08")
date_lfu <- as.Date("2009-08-09")
censor_date(date_dx, date_lfu, 5)
censor_date(date_dx, date_lfu, 6)

TalhoukLab/biostatUtil documentation built on April 14, 2025, 4:15 a.m.