BookmarkSubscribeRSS Feed
Reeza
Super User

That's not the one you need so doesn't affect this question, but will affect future output. I would suggest seeing if a colleague/classmate has not and get it from them. They can change slightly between versions so providing mine wouldn't necessarily solve your issue. 

 


@tbn1 wrote:

Thanks  - I was playing with your old code before I knew what I was doing and I think I changed it already so I do not have the original template.


 

tbn1
Calcite | Level 5

 

Hi Reeza,

 

I reset the template to default and changed ONLY the X axis ticks. I was able to change the X axis. However, I am getting these strange lines from the end of the curve (as shown below). This was happening to me before I changed the template too and I was wondering whether you have seen this before? I have pasted template below.

 

 

CIFPlot5.png

Proc template;
source Stat.Phreg.Graphics.CIF;
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=0 viewmax=5)) yaxisopts=(
         label="Probability");
         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;
JeffMeyers
Barite | Level 11

It looks like the data is connecting itself back at 0 for some reason (the last data point is connecting back to the first). 

 

Try changing your stepplot to look like this:

 

stepplot y=eval(ifn(time<=5,CIF,.)) x=eval(ifn(time <=5,TIME,.)) / group=GROUP index=GROUPINDEX name="CIF";
tbn1
Calcite | Level 5
That does seem like that it is what is happening but that correction made the graph crazier somehow!
JeffMeyers
Barite | Level 11
That is strange. How did it become crazier? I don't know what it does behind the scenes as I only know the dataset it makes when the procedure ends.
Reeza
Super User

That x axis label looks like code, or did you do that on purpose?

tbn1
Calcite | Level 5
That was what happened when I entered the change
JeffMeyers
Barite | Level 11
I also wanted to ask if you are aware that the plots created by PHREG are predicted curves and not the actual observed data? LIFETEST will give CIF curves based on the observed data so I would stick with that. If you don't want to try my macro and don't want to keep messing with the template, why not just output the dataset (outCIF) and then do an SGPLOT or write your own template to make the curve you want? Are you trying to make the template have the same changes every time or are you modifying it to make a single graph?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 23 replies
  • 4985 views
  • 2 likes
  • 3 in conversation