On 2020-04-17 20:06, Medic wrote:
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
I have no experience of left censoring beyond the text book. Is your
left censored data the SAME event or a different 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
So if I read this data correctly the first observation is left censored.
What does the time "5" refer to? Is that 5 days BEFORE observation the
event happened? Or 5 days after another event happened? My text book
understanding of left censored data was that your censored points would
have time 0.
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
Is the censoring type you want LEFT TRUNCATION rather than LEFT. If
they are also right censored I think R Surv calls these Counting.
See: https://folk.ntnu.no/bo/TMA4275/Download/R.tutorialDiez.pdf
Any help?
______________________________________________
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.