Apply.calendar.censoring: Function to apply a given calendar time as effective...

View source: R/Apply.calendar.censoring.R

Apply.calendar.censoringR Documentation

Function to apply a given calendar time as effective censoring time.

Description

Applies administrative censoring at a specified calendar time by truncating each subject's observed event history. For subjects who are still under observation at the calendar cutoff, a censoring record is added at the specified calendar time.

Usage

Apply.calendar.censoring(data, calendar)

Arguments

data

A data frame containing simulated composite endpoint data generated by Onesample.generate.sequential().

calendar

A positive numeric value specifying the calendar time (in years) at which administrative censoring is applied.

Value

A data frame in long format containing the censored composite endpoint data. Each subject contributes all events occurring on or before the specified calendar time, with an additional censoring record added for subjects who have not experienced a terminal event by that time.

Examples

df <- Onesample.generate.sequential(size = 200, recruitment = 3,
calendar = 5, random.censor.rate = 0.05, seed = 1123)
df2 <- Apply.calendar.censoring(data = df, calendar = 4)

gsMeanFreq documentation built on Feb. 17, 2026, 1:07 a.m.