# Dealing with left-, right- and interval-censoring and left- and right-truncation

I have a survival data set with left-, right- and interval-censoring and left- and right-truncation. Now I want to fit a Cox proportional hazard and an AFT model to these data. What is the best way to do that?

Are there functions that can handle data with all of these types of censorings and truncations? I found the icenReg package in R, but I am not sure how to fit the model.

• It seems very unlikely that any single data set has all of those forms of censoring and truncation. Please edit your question to provide more details about your data. It's easy, for example, to confuse truncations and censoring; for example, what appears to be left truncation can sometimes be right censoring. You can get help on that here. Questions specific to R are off-topic on this site. Once it's clear just what type of censoring/truncation is at issue, an answer can describe the best statistical approach along with ways to implement the approach (often in R).
– EdM
Jun 9, 2021 at 16:00
• @EdM This is a simulated data set.
– Tino
Jun 9, 2021 at 16:20
• I wanted to simulate all the possible censoring and truncation types, which can appear in survival data sets.
– Tino
Jun 9, 2021 at 16:32
• That's fine, but you are unlikely to have all of those together in the same real-world data set. If your interest is in learning how to handle these different situations, it's best to use the realistic datasets and examples provided by software packages designed for different contexts. Those illustrate realistic combinations of censorings/truncations in the corresponding context.
– EdM
Jun 9, 2021 at 17:12
• @EdM Which combinations are most likely?
– Tino
Jun 9, 2021 at 18:44

This summarizes the situation with a single event possible per individual and independence between censoring/truncation and event times and also independence among individuals. Klein and Moeschberger, on page 74 of their comprehensive "Survival Analysis: Techniques for Censored and Truncated Data" (Springer; 2nd edition, 2003), clearly explain the types of information available from such data:

An observation corresponding to an exact event time provides information on the probability that the event’s occurring at this time ... For a right-censored observation all we know is that the event time is larger than this time, so the information is the survival function evaluated at the on study time. Similarly for a left-censored observation, all we know is that the event has already occurred, so the contribution to the likelihood is the cumulative distribution function evaluated at the on study time. Finally, for interval-censored data we know only that the event occurred within the interval, so the information is the probability that the event time is in this interval. For truncated data these probabilities are replaced by the appropriate conditional probabilities.

They then show how to express likelihoods for each of these types of data in terms of the probability distribution of individual-associated event times $$f_i(t)$$ and the corresponding survival function $$S_i(t)=1-\int_0^t f_i(\tau) d\tau$$, evaluated at the event, censoring, or truncation times. See this page for details.

If you have a fully parametric form of the survival function (including relationships between individual covariate values and survival), you can thus find the parameter values that maximize the likelihood of the data for combinations of all these types of censoring and truncation. That way you can in principle fit any fully parametric survival model, including parametric accelerated failure time (AFT) models, although I'm not sure that any single software package handles all censoring/truncation patterns. The basic survreg() function in the R survival package can fit several AFT models, including with interval-censored data. The CRAN survival task view describes many other packages designed for specific situations. The flexurv package in particular lets you specify your own parametric form.

You need to be able to let the software know the specific type of each observation. In R, that's generally done with the a Surv() function that can specify time, time2 (for interval data), the event indicator, and the censoring type. With a single kind of event, the censoring type is "right", "left", "counting", or a form of "interval". The "counting" type can represent left truncation at time and right censoring or an event at time2. Right censoring (possibly with left truncation) is most commonly used, in my experience with clinical survival data. In many circumstances (for example, cancer recurrence that develops between scheduled follow-up visits), interval censoring would be more appropriate than the (perhaps unconscious) use of the detection-visit time as the event time.

Interval censoring highlights a major difference between parametric and semi-parametric (e.g., Cox) or non-parametric analysis: "the information is the probability that the event time is in this interval" (see quote above). Without a pre-defined parameterization of $$S_i(t)$$ specifying the forms of probabilities at both ends of the interval, you need a specialized approach. The R coxph() function thus can't analyze interval-censored data properly; for a Cox model you need the special handling provided, for example, by the R icenReg package. Even that package, however, can't fit a semi-parametric AFT model to interval-censored data.

For semi- and non-parametric analysis, reversing the time scale can simplify analysis. For left-censored data, "Instead of measuring time from the origin we fix a large time $$\tau$$ and define new times by $$\tau$$ minus the original times. The data set based on these reverse times is now right-censored" (Klein and Moeschberger, pages 140-141).* Continuing on page 149: "For right-truncated data, only individuals for which the event has occurred by a given date are included in the study... Estimation for this type of data proceeds by reversing the time axis," thus converting right truncation to left truncation. The coxrt package provides methods for analyzing right truncated survival data, with a vignette describing assumptions and issues like bias that can arise.

For further study, a 1997 review by Leung et al in the Annual Review of Public Health provides an accessible introduction to these issues in survival analysis, with an emphasis on censoring. It might make sense to start with that before diving into Klein and Moeschberger. When you do dive into that text, data sets used as illustrative examples of censoring and truncation are in the R KMsurv package.

*Note, however, that "Examples of pure left censoring are rare" (Klein and Moeschberger, page 141), and this warning from the author of icenReg about difficulties in regression modeling with left censoring.

• Is there an R example for fitting pure left-censored data? Sep 10 at 3:11
• @user1916067 if by "pure left-censored data" you mean that you have at least some actual event times but all the other event times are left censored, you can use Klein and Moeschberger"s trick: invert the time scale and thus convert the left censoring to right censoring. "instead of measuring time from the origin we fix a large time $\tau$ and define new times by 􏰾$\tau$ minus the original times" (p. 140). I don't know of written R examples, however. That would work for a non-parametric or a Cox-type regression model, where only the ordering of events matters, not actual event times.
– EdM
Sep 10 at 15:35
• Thanks for the response @EdM. I came across other suggestions of just negating the $$x_i$$ and fitting the model with a survfit e.g result.surv.reverse <- survfit(Surv(-t, delta) ~ 1, conf.int=T, data=Baboons, conf.type="log-log") from here (pg.189 - 191): xsliulab.github.io/Workshop/2021/week3/…. This yields a negative median time and I am not sure how to interpret that. Is this equivalent to what K&M proposed? (A short explanation here will be helpful ) Sep 11 at 4:03
• @user1916067 the approach you cite is equivalent to choosing $\tau=0$ in the K&M proposal. In either case, you need to transform the results back to the original time scale. I haven't had a chance to evaluate the link you provided, but my first reaction is that you just need to negate the predictions made from the model if you choose $\tau=0$. You could check by starting with uncensored data to verify that the back transformation of the time values is correct.
– EdM
Sep 11 at 13:03