Hello, This is my first time doing survival analysis and I tried different intro to cox proportional hazard regression SAS tutorial papers but still I'm not sure if I'm doing this right with the syntax. Attached table is a sample of data I'm working on and the analysis is to track patients from 01/01/2018 to first time they get ESA use (flagged as 1) and date is captured in esa_date and objective is to use the explanatory variables and Identify which variables can predict ESA use and get the hazard ratios. A patient can get censored because they died, lost in the follow-up, or gaps in coverage (like patient E who lost coverage for some period but have ESA use when they got back on coverage - here is used the lost date to calculate time, please let me know if this is not right) Do I have the right syntax to get what I want, which is explanatory variables hazard ratios for ESA use? Personally, I don't know why my outcome of interest esa_use should be specified as explanatory variable. proc phreg data=sample;
class gender (ref="M") esa_use (ref="0") anemia (ref="0")
model time*lost_flag(0)=age gender esa_use anemia_t;
anemia_t=anemia*log(time);
run; Thanks in advance
... View more