BookmarkSubscribeRSS Feed
Fluorite | Level 6

Hi, I'm cleaning a cohort dataset and want to use Cox proportional to analyze. However, I'm confused about assigning the censor data in the coding.


The study lasted 3000 days. The exposure is high salty food and the outcome is the death from stomach cancer. Among the 100,000 participants, 12 patients eventually died from stomach cancer, 38 patients died from other diseases, and the remaining were alive at the end of the study. I'd like to use the cox proportional hazard model to investigate the association between high salty food and the mortality of stomach cancer.


Based on my understanding, we should assign "38 patients died from other diseases" censored (0) , and all the others uncensored (1). But how do we differ the result of dying by stomach cancer and still alive? Will the SAS automatically separate them?


this is the code I use:

proc phreg data=stomach;
class salty(ref="0") bmi(ref="0") gender(ref="0") / param=ref;
model lenfol*censor(0) = salty bmi gender year los;

Could you please check if I correctly understand the model and use the correct codes? Thank you!

Fluorite | Level 6

Hey, thank you for the information. However, I don't think the competing risk model applied to my study. There is no competing relationship between patients alive and dead from stomach cancer. The question I have is I am confused with the define of the censored and uncensored groups here. I confirm that patients who died from other causes should be censored but I have no idea if patients survive until the end of the study belong to censored group or uncensored group. The event I am interested in here is the death from stomach cancer.

Super User

People alive until the end are also censored then, competing risks doesn't necessarily mean competing against each other, but dying for another cause is a competing risk. It is common to ignore this though, competing risks is an analytics level above.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 2 in conversation