Under delayed entry a subject is not at risk before its entry time, so the risk set at t counts only those with entry < t <= observed time. Ignoring the entry times inflates the early risk sets and biases survival upwards. The variance is Greenwood's, accumulated over the same truncated risk sets.
Details
R arm of the existing Python lftrt module.
Formula: S(t) = prod_{t_j <= t} (1 - d_j / n_j) with n_j = #{i : entry_i < t_j <= time_i}.
References
Klein, J. P. and Moeschberger, M. L. (2003). Survival Analysis: Techniques for Censored and Truncated Data, 2nd ed. Springer, section 4.2 and chapter 3.
Examples
Lftrt(c(0, 0, 1, 2), c(5, 6, 7, 8), c(1, 1, 0, 1))
#> $times
#> [1] 5 6 8
#>
#> $survival
#> [1] 0.75 0.50 0.00
#>
#> $se
#> [1] 0.2165064 0.2500000 0.0000000
#>
#> $ci_lower
#> [1] 0.3256553 0.0100090 0.0000000
#>
#> $ci_upper
#> [1] 1.000000 0.989991 0.000000
#>
#> $n_obs
#> [1] 4
#>
#> $n_events
#> [1] 3
#>
