Constructing hazard for x-year survival in cox models If a person wants to assess the 1,5, or 10 year survival of a group of patients how should they consider right censoring for the patients?
Between these 2 options what would be best for this 5 year survival (and are they going to even give different hazards ratios)

*

*Construct the right censor to be censor = alive at 5 years or lost to follow up  before 5 years and then include that in a cox model like so using the survival package in R
coxph(Surv(time_to_death, event=censor_five) ~ age, data = data_surv)
OR


*construct the right censor based on total time such that censor= no record of death
run the same cox model
coxph(Surv(time_to_death, event=censor_total) ~ age, data = data_surv)
 A: Do you estimate impact of the risk factors (and chances of survival depending on the risk factors) or overall survival rate for this group of patients?  For the latter you can take Kaplan-Meier estimator, its value at specific time point won't depend on what happened after.
If you need survival estimate with respect to the risks, then yes, you'll have different estimates from the two versions. The first model doesn't know what happened after 5y, while the second takes it into account. For example, if many people with certain combination of the risk factors died after 5 years, then the hazard for those will be higher in the 2nd model vs 1st.
If all risks affect in the same way throughout all the times (which is Cox assumption), then such differences should be minimal. However, in practice, if your sample is not too large, time-dependence of rates of death for some covariates can happen by chance.
I'd say go for the 2nd option as in the 1st you artificially limit information the sample contains and check Schoenfeld residuals (z=cox.zph(coxmodel), plot(z[1]) for the 1st risk factor) visually if time-dependence is not to strong.
Once hazard ratios were estimated, you should also estimate baseline survival function and then compute 1.5y or 5y survival by taking baseline survival function at time 1.5 or 5 and raising it to the power exp(beta * x). This part is not straightforward in Cox and if you need survival by risk factors, you may prefer parametric models which estimate both baseline and hazard ratios straight away, this is survreg().
So, I'd use all information and either do K-M curve for the overall survival, or Cox if you don't need survival and only the hazard ratios, or parametric survival model with all information, but doing a sensitivity analysis with cutting the tail of your observation time.
