Implications on the formulation of Surv - time and time2 I have a question on the formulation used in the function coxph, in particular on the of the different ways of entering time of the observations in the Surv function.
My results are different if I enter the time when each observation started and stopped:
a. Surv (time =start_ind, time2 = stop_ind, event = death)

As opposed to only adding information of the interval during which the observation took place:
b. Surv (time =stop_ind - start_ind , event = death)

An example of the output for a is (11.215,26.167+] and for b 14.952.
I initially thought that both approaches should give me the same outcome as I expected the interval to be used  in a. However, as the results differ I understand that in a the model may also use the information on how the different events (deaths) are distributed along the study period. For instance, let’s say that in the first two years of the study I have a lot of death related to on given risk factor but after that this was not so important. I understand that the effect of such a risk factor will be less strong in a as it is constrained to one particular period.
In my analysis, I know that there is a lot of temporal variation in the risk factors because the origin of the data varies over time as well as some external factors. In this case I believe it is an important information to add both, time and time2.
Is my interpretation correct? If not, what is the difference between a and b?
 A: A survival model requires a choice about the starting time, time = 0, from which all subsequent survival estimates are made. Your 2 models make substantially different choices.
In the Surv(time1, time2, event) syntax of model a, the time interval is relative to an earlier 0 time. With (time1, time2) of (11.215,26.167), all calculations using that data row are evaluating survival since time = 0. This provides information between time = 11.215 and time = 26.167, for this case and all others still at risk during that time interval. As @Rootless17b says, this is the syntax used when covariate values change over time.
Model b, using the time difference of 14.952 as a single time point in the Surv(time, event) syntax, resets  a time of 11.215 in the original time scale as time =  0 for that case. It will provide information about events that happen between time = 0 and time = 14.952, for this case and all other cases at risk during that time interval. With this formulation each case will have its own choice of time = 0.
In clinical studies time = 0 is usually the time of entry of each participant into the study, say the date of diagnosis of a cancer. If you defined the original time scale in terms of actual calendar dates, this is equivalent to what you have written for model b.
So you have to think carefully about the reference time = 0 after which you want to estimate survival.
A: Approach a is generally used for time-varying covariates. These are covariates that change their value throughout the time of observation. Also you should have multiple rows per subject in your dataset that specifiy each time period (with tstart and tstop) whenever a value changes. You also have to specify the id argument for this approach to work properly. id should be a unique identifier for each subject in the dataset. There is a great vignettes on CRAN how to create such datasets how to calculate a Cox model with time-varying covariates: https://cran.r-project.org/web/packages/survival/vignettes/timedep.pdf
Approach b gives you survival estimates for one time interval (e.g. diagnosis date to date of death in days). Importantly the variables you put into the survfit function or the coxph funtion, should be all known at the start of this interval (e.g. diagnosis date / time point 0). From a cox model based on Survival function b you would then be able to get a Hazard ratios for these variables throughout the time of observation.
In the example you gave, the output for b is correct. It gives you a survival time (= observation time) of 14.952 based on your start and stop dates. In the output for a the model would assume that the time interval between timepoints 11.215 and 26.167 would be one part of the whole survival period. Since you haven´t specified the id argument, I don´t know what the exact behavior would be but I´d assume that it would handle all non-overlapping intervals as one individual.
