# How to use Cox PH model for LOS

I would like to use Cox model to predict hospital length of stay. My data is as follows: Patient ID Length of stay Sex Comorbidity 1 Comorbidity 2 Comorbidity 3 Diagnosis Age Ethnic group Blood Test results

I am a beginner to the Cox model and I am not sure how to fit variables into Surv() function. The time will be LOS, but there is no event (status) in my data as every patient gets discharged at some point. Is it the right way to fit Cox model for LOS coxph(Surv(data$$los) ~ data$$Age + data\$Ethnic_group + other predictors) ?

• It seems you do not have censoring data (every patient gets discharged at some point), so there are other statistical methods that is better or equal to survival analysis (cox PH model belongs to survival analysis). – user158565 Jun 5 '19 at 4:15
• Thank you, looking at literature, it is a very popular method for my problem and it was strongly recommended to me to use it, so there must be a way to use it in these circumstances. – Robin Jun 5 '19 at 6:34
• It is popular because they do not know the reason that we need survival analysis. – user158565 Jun 5 '19 at 15:18

In this type of situation, the event is discharge. The "hazard" at time $$t$$ then represents the "risk" of being discharged at that time, given that the individual hasn't yet been discharged. So a high hazard ratio for one of the covariates would represent a relationship with an earlier discharge time.
So if you are using the R survival package and all patients in your study were discharged, then you could specify a value of 1 for the status of all individuals. You don't even have to do that, as the manual page for the Surv() function says: