- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello all,
I created a kaplan-meier curve using proc lifetest. I just need to output the graph but it's given me headach. This code outputs all tables and graph but I need just the graph.
I also adjusted the template using: %ProvideSurvivalMacros . I guess this can also be set in there, if yes, how? I have been searching the whole day on this issue. Please help. The gout option seems not to be the right approach.
ods pdf output='mypath\filename.pdf'; ods graphics on; proc lifetest data=mydat plots =(s(ATRISK )) ; time T*censor(0); strata group; run;
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
GOUT pertains to SAS/GRAPH you're using ODS GRAPHICS which is an entirely different system.
ODS SELECT/EXCLUDE is what you need.
You can find the table/plot names in the documentation for the procedure, under Details>ODS Table Names/ODS Graphics.
You need to add something similar to :
ODS SELECT plotName;
This should work for you:
ods pdf output='mypath\filename.pdf';
ods graphics on;
ods select survivalPlot;
proc lifetest data=mydat plots =(s(ATRISK )) ;
time T*censor(0);
strata group;
run;
@Anita_n wrote:
Hello all,
I created a kaplan-meier curve using proc lifetest. I just need to output the graph but it's given me headach. This code outputs all tables and graph but I need just the graph.
I also adjusted the template using: %ProvideSurvivalMacros . I guess this can also be set in there, if yes, how? I have been searching the whole day on this issue. Please help. The gout option seems not to be the right approach.
ods pdf output='mypath\filename.pdf'; ods graphics on; proc lifetest data=mydat plots =(s(ATRISK )) ; time T*censor(0); strata group; run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Reeza Thanks for that. I tried that but I got this error message:
ERROR 22-322: Syntax error, one of the following is expected: ;, (, ACCESSIBLE, ACCESSIBLE_IDENTIFIER, ANCHOR, AUTHOR, BACKGROUND, BASE, BODY, BOOKMARK, BOOKMARKGEN, BOOKMARKLIST, BOX_SIZING, CLOSE, COLOR, COLUMNS, COMPRESS, CONTENTS, CSSSTYLE, DISPLAY, DOM, DPI, EXCLUDE, FILE, FONTSCALE, GFOOTNOTE, GTITLE, HOST, KEYWORDS, NAMED_DEST, NEWFILE, NOACCESSIBLE, NOACCESSIBLE_IDENTIFIER, NOBACKGROUND, NOBOOKMARKGEN, NOBOOKMARKLIST, NOCOLOR, NOCONTENTS, NOGFOOTNOTE, NOGTITLE, NOPDFNOTE, NOTOC, PACKAGE, PCL, PDF, PDFMARK, PDFNOTE, PDFTOC, PRINTER, PS, SAS, SELECT, SGE, SHOW, STARTPAGE, STYLE, SUBJECT, TEXT, TITLE, UNIFORM. ERROR 76-322: Syntax error, statement will be ignored. 466 ods graphics on; 467 ods select survivalPlot; 468 proc lifetest data=mydata plots =(s(ATRISK )) ; 469 time T*censor(0); 470 strata GROUP; 471 run;
I think it has a problem with the ods pdf output statement because output is underlined as error. But the
ods select survivalPlot;
worked. only I had no pdf file outputted
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I assumed you posted working code but realizing now your ODS PDF statement is wrong and you should have been getting errors before even though you said it was giving you output.
ODS PDF requires a FILE= not OUTPUT=.
https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/n0mc4eolqoned0n16oy88mpj0e4g.htm
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
@Reeza yes, I also tried using ods pdf file="mypath\mydoc.pdf", this doesn't quite display an error but doesn't also output any file
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
ods pdf file='mypath\mydoc.pdf'; ods graphics on; ods select survivalPlot; proc lifetest data=mydat plots =(s(ATRISK )) ; time T*censor(0); strata group; run;
NOTE: The LOGLOG transform is used to compute the confidence limits for the quartiles of the
survivor distribution. To suppress using this transform, specify CONFTYPE=LINEAR in the PROC
LIFETEST statement.
NOTE: Used was: PROZEDUR LIFETEST - (Total processing time):
real time 1.00 seconds
cpu time 0.21 seconds
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
yes, you are right, it worked now. I really forgot to add ods pdf close. Thanks