BookmarkSubscribeRSS Feed
Lostinstats
Calcite | Level 5

Hello everyone,

 

I am working on survival data with incidence of cancer and some food consumption data in quartiles.

Exposition : quartile of sugared food

Confusion factor : age, BMI, sex.

Outcome : cancer

 

I would like to draw a curve of cumulative hazard rate function (for example with Nelson Aalen estimator, a non parametric estimator of the cumulative hazard rate function) like this graph below : where we would see the cumulative risk of cancer in function of the 4 quartiles of food consumption.

nelson Aalen curve.JPG

Caption of the graph : "Nelson-Aalen curves showing the outcome of new-onset overweight depending on ultraprocessed food consumption at baseline. Adjusted for sex, age, marital status, educational status"

 

If someone had an idea of a beginning of script, i would be really grateful.

i am doing Cox model with this type of script :

proc phreg data=mydata;
class sexe;
model survival_time*censure(1)=sexe age IMC;
strata quartile_ultraprocessed ;
    run;

Thanks in advance, have a nice day,

4 REPLIES 4
Reeza
Super User

Have you tried adding the PLOTSooption to your PROC statement?

 

You'll want tthe 'statistical' style to get the curves in a similar format but you'll have to manually add the data at the top. If you can post it at the bottom of the graph that could be more easily incorporated.

 

 

JacobSimonsen
Barite | Level 11

You can get the cumulative hazard (Nelson Aalen) by using the baseline statement in PHREG;

 

As Nelson Aalen only can account for one combination of covariates at a time you will need to put all covariates into the strata statement.

 

Here is a simple example:

data test;
do i=1 to 100;
x=mod(i,2);
t=rand('exponential',1);
output;
end;
run;

proc phreg data=test;
  model t=;
  strata x;
  baseline out=baseline cumhaz=cumhaz;
run; 

You can then plot the hazard by using proc gplot or sgplot.

 

Lostinstats
Calcite | Level 5

thanks for your answers.


I tested your statements but I don't know why when I look at the table "baseline" created and containing "Cumulative Hazard function estimates", there are only about 2000 observations. And in my dataset of departure, I have about 100 000 observations (about 2200 events and 97 800 censored). Do you have an idea why I have this decrease ?

 

have a nice day,

JacobSimonsen
Barite | Level 11

the estimated cumulative hazard function only has as many jumps (its a step function) as there are uncensored events. So wiht 2200 events it should have 2200 observations.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 3127 views
  • 0 likes
  • 3 in conversation