Hello I am learning about survival analysis and am getting exposed to interval censoring.
I was curious why when using the
survfit function from
survival package that the number at risk at time 0 is 1 greater then the number of observations? Is there a theoretical reason or it it a problem with my R code?
set.seed(123) library(survival) # Continuous Time ---- size = 10 deathtime <- seq(1, size) death = rep(1, size) df <- data.frame(deathtime, death) surv.obj<- Surv(df$deathtime, df$death) summary(survfit(surv.obj ~ 1))
Makes sense at time 1 there is 10 at risk since there is 10 observations.
# Interval Time ---- start <- seq(0, size - 1) end <- seq(1,size) death <- rep(1, size) df.i <- data.frame(start, end, death) surv.obj.i <- Surv(time = df.i$start, time2 = df.i$end, event = df.i$death, type = "interval") summary(survfit(surv.obj.i ~ 1))
Why does with interval censoring at time 0 there is a number of risk of 11? There is only 10 observations.