tdc_in_study: participants over time

View source: R/tdc_functions.R

tdc_in_studyR Documentation

participants over time

Description

survival::tmerge creates time periods (per patient) starting at 'tstart' and ending at 'tstop'. This function counts the number of individuals in the study at each time point of interest (set of all distinct time points starting or ending an interval). For each such point, a patient is in the study at T if they have a time period starting at, or before, T, AND the corresponding end strictly after T.

Usage

tdc_in_study(x, tstart = "tstart", tstop = "tstop")

Arguments

x

data frame with time periods starting at tstart, ending at tstop.

tstart

name of variable acting as tstart

tstop

name of variable acting as tstop

Value

data frame with variables 'time' and 'in.study' (count)


renlund/datma documentation built on June 2, 2025, 5:12 a.m.