This function accepts a data frame that is a USRDS longitudinal cohort, and returns the same object with the
tstart and tstop variables shifted to an appropriate baseline t=0 as specified by baseline_date_variable.
Arguments
- USRDS_cohort
is a USRDS cohort created using the
create_usrds_cohort()function- baseline_date_variable,
if not NULL, includes the name of the variable in
USRDS_cohortthat determines the t0 date for each row of the cohort
Details
Of note,baseline_date_variable does NOT have to be constant within each patient. If the baseline is the time since most recent transplant,
for example, and a patient has multiple transplants within the USRDS_cohort, it may be appropriate for different observations periods for the
same patient to use different baseline dates.
If baseline_date_variable is unspecified or specified as NULL, its default value, a default baseline value will be calculated for each patient such that
each patient's first observation has tstart=0.
