I am stocked with a KM estimated risk ratio, hazard ratio, adjusted hazard ratio. Is there a code to analyze this estimates in sas?
I know you can get hazard ratio with proc phreg.
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.
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:
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 Yes, I have a raw data but the GitHub link seems complicated for me.
@Reeza I don't want the CI in percent. I want the Confidence interval and p-value of the failure rate.
@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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.