06-01-2015 05:23 AM
I am trying to create a line graph showing Hazard Ratio over time using the following axis below:
Hazard Ratio 6
0 20 40 60 80 100 120 140
I have create the hazard ratios for the tables but am unsure now how to plot them and what procedure I need to use to create the plot. If anyone can help to get me started that would be great.
Here is the syntax used to create ratios:
Proc phreg data=&infile;
Model personyrs*outcome(0) = exposure &covariates trtt /RISKLIMITS;;
trtt = exposure*log(PersonTime);
test_proportionality: TEST trtt;
ods output ParameterEstimates=HR&infile;
title1 "Proc PHREG for adjusted";
06-01-2015 05:37 AM
Hello, I'm guessing you can use the Series statement within SGPLOT to get the plot that you want.
Can you please include the &infile dataset or the HR&infile dataset so that I can verify?
06-01-2015 06:14 AM
I am not sure how to attach a file, so have copied and pasted the information from the dataset HR&infile created by the proc phreg procedure
Parameter Standard Hazard 95% Hazard Ratio
Parameter DF Estimate Error Chi-Square Pr > ChiSq Ratio Confidence Limits Label
Exposure 0 1 -12.89787 0.26728 2328.6241 <.0001 0.000 0.000 0.000 Exposure 0
Age_At_Index 1 0.04090 0.00188 473.8845 <.0001 1.042 1.038 1.046
trtt 1 -2.24461 0.04631 2349.3378 <.0001 0.106 0.097 0.116
06-01-2015 06:39 AM
Okay, the output for the table you have included above is usually for a forest plot. Maybe that is the plot you are after? An example of a forest plot can be found here: http://blogs.sas.com/content/graphicallyspeaking/2013/01/06/forest-plot-with-sas-9-3/
In the figure you want to produce, you have time on the x-axis. Have you also outputted a dataset that includes the time and the hazard ratio's?