BookmarkSubscribeRSS Feed
lansoprazole
Obsidian | Level 7

Hi, 

 

I am trying to expand the Y-axis (probability) of CIF plot that is created by PROC PHREG. 

 

I found that TIMERANGE and RANGE only change the X-axis range (I was able to customize the X-axis range).

 

Is there any option to change the Y-axis to be between 0 - 1?

 

This is my first line code;

proc phreg data = XYZ plots (range = (0,15))= cif;

 

Thanks,

W

1 REPLY 1
Zard
SAS Employee

If you still need it... you can modify the plot template to customize the y-axis range in a CIF plot. 

 

Here is a default plot:

 

ods select CIFPlot;
proc phreg data=Bmt plots(overlay)=cif;
  class Disease;
  model T*Status(0)=Disease / eventcode(cox)=1;
  baseline covariates=Risk;
run;

 

Zard_0-1682609968951.png

 

You can add the following LinearOpts= in the YaxisOpts option to specify your own y-axis range:

 

proc template;
  define statgraph Stat.PHReg.Graphics.Cif;
    dynamic title1 title2 title3 title4 xviewMin xviewMax group groupIndex
      groupName plotCL transparency _byline_ _bytitle_ _byfootnote_;
    BeginGraph;
      entrytitle TITLE1 TITLE3;
      entrytitle TITLE2 TITLE4 / textattrs=GRAPHVALUETEXT;
      layout overlay / xaxisopts=(linearopts=(viewmin=XVIEWMIN viewmax=
       XVIEWMAX)) yaxisopts=(label="Probability"
       linearopts=(viewmin=0 viewmax=1 tickvaluelist=(0 .2 .4 .6 .8 1.0)));
       if (PLOTCL)
        bandplot LimitLower=LOWERCIF LimitUpper=UPPERCIF x=TIME / group
          =GROUP index=GROUPINDEX modelname="CIF" datatransparency=
          transparency;
       endif;
      stepplot y=CIF x=TIME / group=GROUP index=GROUPINDEX name="CIF";
      if (EXISTS(GROUP))
        discretelegend "CIF" / location=outside title=GROUPNAME;
      endif;
    endlayout;
    if (_BYTITLE_)
      entrytitle _BYLINE_ / textattrs=GRAPHVALUETEXT;
    else
      if (_BYFOOTNOTE_)
        entryfootnote halign=left _BYLINE_;
     endif;
    endif;
    EndGraph;
  end;
run;
ods select CIFPlot;
proc phreg data=Bmt plots(overlay range=0,500)=cif;
  class Disease;
  model T*Status(0)=Disease / eventcode(cox)=1;
  baseline covariates=Risk;
run;

Zard_1-1682610096482.png

 

Delete the modified template to revert back to the default plot:

 

proc template;
  delete Stat.PHReg.Graphics.Cif;
run;

 

 

SAS INNOVATE 2024

Innovate_SAS_Blue.png

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
  • 1 reply
  • 679 views
  • 0 likes
  • 2 in conversation