<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Plot a line in specific coordinate(survival plot) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Plot-a-line-in-specific-coordinate-survival-plot/m-p/879272#M347372</link>
    <description>&lt;P&gt;In the KM chapter I mentioned, find the section "Adding a Custom Header above the At-Risk Table". It provides a basic illustration of annotation. The text mentions annotation statements.&amp;nbsp; In SG plotting procedures (not relevant here but mentioned to provide context), you provide an annotation data set. In a graph template and SGRENDER, you provide annotation statements.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Jun 2023 16:41:17 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2023-06-05T16:41:17Z</dc:date>
    <item>
      <title>Plot a line in specific coordinate(survival plot)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Plot-a-line-in-specific-coordinate-survival-plot/m-p/878782#M347194</link>
      <description>&lt;P&gt;Hi, I want to plot a line in a specific value of x axis in a survivalplot, I tried to use an annotate data to do it. As you can see in my annotation data, that I call "anno", I using the 'LINE' function, but it is not working the way I want! I want to use my data values in the coordinates of the line, but when I put any drawspace with exception of the "GRAPHPERCENT", the function apparently does not work, any idea of what is wrong with my script?&amp;nbsp; Here is my sas code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;data sp;
	set sashelp.BMT;
run;


proc sgrender data=sp template=Stat.Lifetest.Graphics.ProductLimitSurvival; run;


ods document name=MyDoc(write); 
proc lifetest data=sashelp.BMT plots=survival(cb=hw test); 
	ods output survivalplot=sp; 
	ods select survivalplot; 
	time T * Status(0); 
	strata Group; 
run; 
ods document close;

proc document name=MyDoc; 
	list/levels=all; 
quit;

proc document name=MyDoc; 
	ods output dynamics=outdynam; 
	obdynam \Lifetest#1\SurvivalPlot#1; 
quit;

data anno;
	 length label $100 function fillcolor linecolor $25;
	 retain drawspace 'datavalue' linethickness 3 display 'ALL'
	 widthunit 'data' heightunit 'data' anchor 'left';

	Function ='LINE'; x1 =	500;	y1 = 0.2;	x2 = 500;	y2 = 0.8; linecolor='black'; fillcolor='black';*drawspace='datavalue';
	output;
run;


proc print noobs; 
run;


%ProvideSurvivalMacros

%macro StmtsBeginGraph; annotate; %mend; 

%CompileSurvivalTemplates



proc template; 
	source Stat.Lifetest.Graphics.ProductLimitSurvival / file='temp.tmp'; 
quit;



data _null_; 
	infile 'temp.tmp'; 
	input; 
	if _n_ = 1 then call execute('proc template;'); 
	call execute(_infile_); 
	if _infile_ =: 'BeginGraph' then bg + 1; 
	if bg and index(_infile_,';') then do; 
		bg = 0; 
		call execute('annotate;'); 
	end; 
run;


data _null_; 
	set outdynam(where=(label1 ne '___NOBS___')) end=eof; 
	if nmiss(nvalue1) and cvalue1= '.' then cvalue1= ' '; 
	if _n_ = 1 then do; 
		call execute('proc sgrender data=sp sganno=anno'); 
		call execute('template=Stat.Lifetest.Graphics.ProductLimitSurvival;'); 
		call execute('dynamic'); 
	end; 
	if label1 = 'Transparency' then cvalue1 = '0.9'; 
	if cvalue1 ne ' ' then 
		call execute(catx(' ', label1, '=', 
					ifc(n(nvalue1), cvalue1, quote(trim(cvalue1))))); 
	if eof then call execute('; run;'); 
run;

proc sgrender data=sp sganno=anno 
			template=Stat.Lifetest.Graphics.ProductLimitSurvival; 
	dynamic NSTRATA = 3 PLOTATRISK = 0 PLOTHW = 1 PLOTEP = 0 PLOTCL=0 
		PLOTCENSORED = 1 Transparency = 0.9 PLOTTEST = 1 PVALUE = 0.0010059117 
		METHOD = "Product-Limit" XNAME = "T" LABELHW = "95% Hall-Wellner Band" 
		SECONDTITLE="With 95% Hall-Wellner Bands" GROUPNAME = "DiseaseGroup" 
		TESTNAME="Logrank"; 
run;

proc template; 
	delete Stat.Lifetest.Graphics.ProductLimitSurvival; 
quit;



&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Im following this&amp;nbsp;PharmaSUG2016 documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 19:11:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Plot-a-line-in-specific-coordinate-survival-plot/m-p/878782#M347194</guid>
      <dc:creator>lorenzo_moraes</dc:creator>
      <dc:date>2023-06-01T19:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Plot a line in specific coordinate(survival plot)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Plot-a-line-in-specific-coordinate-survival-plot/m-p/879189#M347348</link>
      <description>&lt;P&gt;I'll try to look over what you are doing tomorrow. In the mean time, you should know that this is the latest version of the KM plot modification examples.&amp;nbsp; &lt;A href="https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf" target="_blank"&gt;https://support.sas.com/documentation/onlinedoc/stat/151/kaplan.pdf&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jun 2023 20:01:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Plot-a-line-in-specific-coordinate-survival-plot/m-p/879189#M347348</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2023-06-04T20:01:05Z</dc:date>
    </item>
    <item>
      <title>Re: Plot a line in specific coordinate(survival plot)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Plot-a-line-in-specific-coordinate-survival-plot/m-p/879272#M347372</link>
      <description>&lt;P&gt;In the KM chapter I mentioned, find the section "Adding a Custom Header above the At-Risk Table". It provides a basic illustration of annotation. The text mentions annotation statements.&amp;nbsp; In SG plotting procedures (not relevant here but mentioned to provide context), you provide an annotation data set. In a graph template and SGRENDER, you provide annotation statements.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jun 2023 16:41:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Plot-a-line-in-specific-coordinate-survival-plot/m-p/879272#M347372</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2023-06-05T16:41:17Z</dc:date>
    </item>
  </channel>
</rss>

