BookmarkSubscribeRSS Feed
CathyVI
Pyrite | Level 9

I am stocked with a KM estimated risk ratio, hazard ratio, adjusted hazard ratio. Is there a code to analyze this estimates in sas?

CathyVI_1-1642710906445.png

 

10 REPLIES 10
Reeza
Super User
Are you sure you're asking the correct question? Can you add more details as to what you're trying to do here?

tarheel13
Rhodochrosite | Level 12

I know you can get hazard ratio with proc phreg.

CathyVI
Pyrite | Level 9

@Reeza @tarheel13 

I got the Kaplan Meier estimated risk ratio (0.377) from the Product-Limit Survival Estimates of Treatment & placebo by dividing the failure rate of the treatment group by the failure rate of the placebo group and subtract the result from 1 i.e., (1-failure rate treatment / failure rate Placebo).

So my first questions is cant SAS do it for me without me manually doing the division and subtraction for the proportion? This is my code that produces the Product-Limit Survival Estimates.

 

proc lifetest data=a ;
time specimen*censor6(0);
strata pp/TEST;
run;

 

Second question is how do I calculate the p-value and confidence Interval just like in the table table, I have tried to add (TEST function for p-value of a homogeneity test specified in the STRATA statement but I didn't get it.

 

 
 
Reeza
Super User

https://gist.github.com/statgeek/d3bce2a9e2ef0523db9d

 

Do you have raw data and you're trying to calculate your ratios as in the first post?

 


@CathyVI wrote:

@Reeza @tarheel13 

I got the Kaplan Meier estimated risk ratio (0.377) from the Product-Limit Survival Estimates of Treatment & placebo by dividing the failure rate of the treatment group by the failure rate of the placebo group and subtract the result from 1 i.e., (1-failure rate treatment / failure rate Placebo).

So my first questions is cant SAS do it for me without me manually doing the division and subtraction for the proportion? This is my code that produces the Product-Limit Survival Estimates.

 

proc lifetest data=a ;
time specimen*censor6(0);
strata pp/TEST;
run;

 

Second question is how do I calculate the p-value and confidence Interval just like in the table table, I have tried to add (TEST function for p-value of a homogeneity test specified in the STRATA statement but I didn't get it.

 

 
 

 

CathyVI
Pyrite | Level 9

@Reeza Yes, I have a raw data but the GitHub link seems complicated for me. 

Reeza
Super User
Did you run it? You would need to modify where it saves the output, last parameter.
Run it, see if something in there is similar to what you need then figure out how you can call it for your data.
You're just changing the last line of code.
CathyVI
Pyrite | Level 9

@Reeza I don't want the CI in percent. I want the Confidence interval and p-value of the failure rate.

Reeza
Super User
"I got the Kaplan Meier estimated risk ratio (0.377) from the Product-Limit Survival Estimates of Treatment & placebo by dividing the failure rate of the treatment group by the failure rate of the placebo group and subtract the result from 1 "

I'm not familiar with that calculation so not sure how you'd go about getting a confidence interval for it to be honest.
CathyVI
Pyrite | Level 9

@Reeza I saw one of your previous comment online 

Solved: How to get confidence interval for failure rate in... - SAS Support Communities and maybe you can use this comment to help me.

In the table above, I wanted to calculate the Vaccine Efficacy(VE) 0.377 and its CI and P-value. This is the same dataset so i should get the same result.

I used the follow code to the get the failure rate, see table below. When I divided the failure rates(yellow highlighted) from each other I got 0.3590/0.5778 = 0.6213222568. 1-0.6213222568 = 0.3786

which i think is the same VE result they got. How do i get this result in sas without manually calculating it.

 

proc lifetest data=a ;
time specimenint*censor6(0);
strata pp;
run;

Thanks

pic1.pngpic2.pngpic3.png

 

 

 

 

Reeza
Super User
You can estimates for a specific time point. Was there something in the experimental design about the time point/end point? You would put that in the TIMELIST component to get estimates at that specific time point.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

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

View all other training opportunities.

Discussion stats
  • 10 replies
  • 1106 views
  • 1 like
  • 3 in conversation