Calculation of Efron's re-distribution to the right algorithm to obtain the Kaplan-Meier estimate.

redist(time, status)

Arguments

time

A numeric vector of event times.

status

The event status vector takes the value 1 for observed events and the value 0 for right censored times.

Value

Calculations needed to

See also

prodlim

Author

Thomas A. Gerds <tag@biostat.ku.dk>

Examples

redist(time=c(.35,0.4,.51,.51,.7,.73),status=c(0,1,1,0,0,1))
#> 
#> Kaplan-Meier estimate via re-distribution to the right algorithm:
#> 
#> Subject 1:
#> ---------------------------
#> Survival before = 100%
#> No event until time = 0.35
#> Re-distribute mass 0.17 to remaining 5 subjects
#> Survival after = 100%
#> 
#> Subject 2:
#> ---------------------------
#> Survival before = 100%
#> Event at time = 0.4
#> Contribution to Kaplan-Meier estimate:
#> 
#>                  fractions decimal
#> own contribution 1/6       0.16667
#> from subject 1   1/6*1/5   0.03333
#>                  sum       0.2000 
#> 
#> Survival after = 100% - (1/6 + 1/6*1/5)
#>                = 100% - 20% = 80%
#> 
#> Subject 3:
#> ---------------------------
#> Survival before = 80%
#> Event at time = 0.51
#> Contribution to Kaplan-Meier estimate:
#> 
#>                  fractions decimal
#> own contribution 1/6       0.16667
#> from subject 1   1/6*1/5   0.03333
#>                  sum       0.2000 
#> 
#> Survival after = 80% - (1/6 + 1/6*1/5)
#>                = 80% - 20% = 60%
#> 
#> Subject 4:
#> ---------------------------
#> Survival before = 60%
#> No event until time = 0.51
#> Re-distribute mass 0.2 to remaining 2 subjects
#> Survival after = 60%
#> 
#> Subject 5:
#> ---------------------------
#> Survival before = 60%
#> No event until time = 0.7
#> Re-distribute mass 0.3 to remaining 1 subject
#> Survival after = 60%
#> 
#> Subject 6:
#> ---------------------------
#> Survival before = 60%
#> Event at time = 0.73
#> Contribution to Kaplan-Meier estimate:
#> 
#>                  fractions       decimal
#> own contribution 1/6             0.16667
#> from subject 1   1/6*1/5         0.03333
#> from subject 4   1/6*1/2         0.08333
#>                  1/6*1/5*1/2     0.01667
#> from subject 5   1/6*1/1         0.16667
#>                  1/6*1/5*1/1     0.03333
#>                  1/6*1/2*1/1     0.08333
#>                  1/6*1/5*1/2*1/1 0.01667
#>                  sum             0.6000 
#> 
#> Survival after = 60% - (1/6 + 1/6*1/5 + 1/6*1/2 + 1/6*1/5*1/2 + 1/6*1/1 + 1/6*1/5*1/1 + 1/6*1/2*1/1 + 1/6*1/5*1/2*1/1)
#>                = 60% - 60% = 0%
#> 
#> Summary table:
#> 
#> NULL