I can't understand how to do a survival analysis (?Surv ()) when some event occurred before the start of observation (left censored). If I understand correctly, there are two methods. I chose a method with: 1) time from the start of treatment to the event and 2) the indicator of the event. I did (in my data) the event indicator so: 1 - event, 2 - event before the start of observation, 0 - no event --- library(survival) left_censor_data <- read.table("left.csv", header = TRUE, sep = ";") #sep = ";" it's right! dput(left_censor_data, file="left_censor_data") #file attached left_censor_data 'data.frame': 11 obs. of 2 variables: $ timee : int 5 151 33 37 75 14 7 9 1 45 ... $ eventt: int 2 0 0 0 0 0 0 2 0 1 ... # 1—event, 2 – event before the start of observation , 0 – no event
sur <- Surv(time = left_censor_data$timee, event = left_censor_data$eventt, type = "left") Warning message: In Surv(time = left_censor_data$timee, event = left_censor_data$eventt, : Invalid status value, converted to NA #Why such a message? #Then everything turns out wrong ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.