I don't know how, but the survival curve that should be descending is coming out upwards. Actually I'm getting the cumulative incidence curve. Any ideas on how to find and fix the problem? Thank you!
A piece of the df:
id<-c(11001, 11731, 12220, 16530, 99290, 100500)
time<-c(51,60,24,60,60,55)
event<-c(1,0,1,0,0,1)
df<-data.frame(id,time,event)
The code I tried:
df$id<-factor(df$id)
df$event<-factor(df$event)
# time is interger
a<-Surv(df$time, df$event)
km<-survfit(a~1,df)
plot(km)
I have used this code countless times before, I really don't know what is happening.