fid.Rd
Helps to find ties in death times of data.
fid(x, index)
A list with two arguments.
A vector of indices for the first observation at each death time as they appear in the sorted list.
If there are no ties at all, this is NULL. If not, this is a list with length equal to the number of unique times with ties. For each time with ties, index_ties gives the indices of the observations with a death at that time.
# Example with no ties
glmnet:::fid(c(1, 4, 5, 6), 1:5)
#> $index_first
#> [1] 1 2 3 4 5
#>
#> $index_ties
#> NULL
#>
# Example with ties
glmnet:::fid(c(1, 1, 1, 2, 3, 3, 4, 4, 4), 1:9)
#> $index_first
#> [1] 1 4 5 7
#>
#> $index_ties
#> $index_ties$`1`
#> [1] 1 2 3
#>
#> $index_ties$`3`
#> [1] 5 6
#>
#> $index_ties$`4`
#> [1] 7 8 9
#>
#>