<?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 How to plot cumulative incidence with number at risk from survival analysis with competing risk usin in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950215#M47518</link>
    <description>&lt;P&gt;How to plot cumulative incidence with number at risk from survival analysis with competing risk (see code below)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics on;&lt;BR /&gt;proc lifetest data=dataname plots=cif(test ) notable timelist=0 6 12 18 24 36 48 60 OUTCIF=cifnrm_out;&lt;BR /&gt;time time*event(0)/eventcode=1;&lt;BR /&gt;strata group/order=internal;&lt;BR /&gt;run;&lt;BR /&gt;ods graphics off;&lt;/P&gt;</description>
    <pubDate>Fri, 08 Nov 2024 14:49:25 GMT</pubDate>
    <dc:creator>lih</dc:creator>
    <dc:date>2024-11-08T14:49:25Z</dc:date>
    <item>
      <title>How to plot cumulative incidence with number at risk from survival analysis with competing risk usin</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950215#M47518</link>
      <description>&lt;P&gt;How to plot cumulative incidence with number at risk from survival analysis with competing risk (see code below)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ods graphics on;&lt;BR /&gt;proc lifetest data=dataname plots=cif(test ) notable timelist=0 6 12 18 24 36 48 60 OUTCIF=cifnrm_out;&lt;BR /&gt;time time*event(0)/eventcode=1;&lt;BR /&gt;strata group/order=internal;&lt;BR /&gt;run;&lt;BR /&gt;ods graphics off;&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 14:49:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950215#M47518</guid>
      <dc:creator>lih</dc:creator>
      <dc:date>2024-11-08T14:49:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950223#M47519</link>
      <description>&lt;P&gt;When using the EVENTCODE= option for a competing risks analysis PROC LIFETEST does not support the ATRISK plot option.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Nov 2024 15:13:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950223#M47519</guid>
      <dc:creator>OsoGris</dc:creator>
      <dc:date>2024-11-08T15:13:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950276#M47521</link>
      <description>&lt;P&gt;You want this ?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc lifetest data=sashelp.bmt plots=cif(test ) notable  OUTCIF=cifnrm_out ;
time t*status(0)/eventcode=1;
strata group/order=internal;
run;



data time;
do t=0 to 2500 by 500;
 output;
end;
run;
proc sql;
create table temp as
select * from (select distinct Group from cifnrm_out),time order by 1,2;
quit;
data want;
 set cifnrm_out temp(in=inb);
 by Group t;
 retain temp;
 if first.Group then call missing(temp);
 if not missing(AtRisk) then temp=AtRisk;
 if inb then time_AtRisk=temp;
 keep Group t AtRisk CIF time_AtRisk ;
run;
options missing=' ';
proc sgplot data=want;
step x=T y=CIF/group=Group;
xaxistable time_AtRisk/class=group colorgroup=Group location=inside;
xaxis label='Disease-Free Survival Time';
yaxis values=(0 to 1 by 0.2);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1731120144011.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/102052i777B91D789FD61E4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1731120144011.png" alt="Ksharp_0-1731120144011.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 09 Nov 2024 02:42:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950276#M47521</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-11-09T02:42:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950388#M47524</link>
      <description>&lt;P&gt;This is great!&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2024 20:32:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/950388#M47524</guid>
      <dc:creator>lih</dc:creator>
      <dc:date>2024-11-11T20:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954116#M47727</link>
      <description>&lt;P&gt;This is great info to create the plot including number of risk.&amp;nbsp; I followed the steps but in the end, I only got this (attached).&amp;nbsp; No numbers shown.&amp;nbsp; I am not sure why.&amp;nbsp; Any insights?&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;SAS Code I used:&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc sgplot data=test;&lt;/DIV&gt;&lt;DIV&gt;step x=timeBDD_3 y=CIF/group=pred_opt_ter;&lt;/DIV&gt;&lt;DIV&gt;xaxistable time_AtRisk/class=pred_opt_ter colorgroup=pred_opt_ter location=inside;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;xaxis values=(0 to 3.25 by 0.5) labelattrs=(size=13) valueattrs=(size=13)&amp;nbsp; ;&amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;yaxis&amp;nbsp; values=(0 to 0.2 by 0.05) label= "Probability" labelattrs=(size=13) valueattrs=(size=13);&lt;/DIV&gt;&lt;DIV&gt;xaxis label='Years';&lt;/DIV&gt;&lt;DIV&gt;keylegend&amp;nbsp; /&amp;nbsp; title='Predicted Probability' location=outside position=bottom across=3&amp;nbsp; valueattrs=(size=12) TITLEATTRS=(size=12);&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; title h=12pt 'Probability of MACE by Optimal CT Predicted Probability Tertiles';&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;format pred_opt_ter gp.;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 00:21:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954116#M47727</guid>
      <dc:creator>J_Park</dc:creator>
      <dc:date>2024-12-19T00:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954119#M47728</link>
      <description>Plz post your sample data,so I can test it .&lt;BR /&gt;And post your FULL code, you should notice that I have one more data step to get the number of risk before PROC SGPLOT ,but you didn't post it yet.</description>
      <pubDate>Thu, 19 Dec 2024 01:30:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954119#M47728</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-19T01:30:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954177#M47729</link>
      <description>Hello,&lt;BR /&gt;This is the full sas code I used.&amp;nbsp; I was able to add the number at risk but they are identical across the time.&amp;nbsp; &amp;nbsp;I can't figure out why.&amp;nbsp; &amp;nbsp;I would appreciate any insights.&amp;nbsp; &amp;nbsp;The data attached is a mock up data as I can't send the actual data.&lt;BR /&gt;Thank you!JP&lt;BR /&gt;&lt;BR /&gt;data model1_tert2(keep= T Group eventstatus );&amp;nbsp; set model1_tert ;&amp;nbsp; &amp;nbsp; &amp;nbsp;rename&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; timeBDD_3 = T&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pred_opt_ter = Group&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; eventBDD_3 = eventstatus;&amp;nbsp; run;&lt;BR /&gt;&lt;BR /&gt;proc lifetest data=model1_tert2&amp;nbsp; plots=cif(test ) notable&amp;nbsp; OUTCIF=cifnrm_out ;&amp;nbsp; &amp;nbsp; &amp;nbsp;time T*eventstatus(0)/eventcode=1;&amp;nbsp; strata Group/order=internal;&amp;nbsp;run;&lt;BR /&gt;&lt;BR /&gt;data time;do t=0 to 3.0 by 0.5;&amp;nbsp;output;end;run;&lt;BR /&gt;proc sql;create table temp asselect * from (select distinct Group from cifnrm_out),time order by 1,2;quit;&lt;BR /&gt;data test;&amp;nbsp;set cifnrm_out temp(in=inb);&amp;nbsp;by Group ;&amp;nbsp;retain temp;&amp;nbsp;if first.Group then call missing(temp);&amp;nbsp;if not missing(AtRisk) then temp=AtRisk;&amp;nbsp;if inb then time_AtRisk=temp;&amp;nbsp;keep Group T AtRisk CIF time_AtRisk ;run;&lt;BR /&gt;&lt;BR /&gt;proc format ;&amp;nbsp;value group0&amp;nbsp; &amp;nbsp;= "&amp;lt;0.02"1&amp;nbsp; &amp;nbsp;= "0.02-0.03"2&amp;nbsp; &amp;nbsp;= "&amp;gt;0.03";quit;&lt;BR /&gt;&lt;BR /&gt;options missing=' ';&lt;BR /&gt;proc sgplot data=test noborder;styleattrs datacontrastcolors=(green blue darkred);&amp;nbsp;&amp;nbsp; step x=T y=cif /&amp;nbsp; group=group name='plaque'&amp;nbsp; lineattrs=(thickness=4 pattern = SOLID) ;&amp;nbsp; &amp;nbsp;keylegend 'plaque' /&amp;nbsp; title='Predicted Probability' location=outside position=bottom across=3&amp;nbsp; valueattrs=(size=12) TITLEATTRS=(size=12);&lt;BR /&gt;&amp;nbsp; xaxistable time_AtRisk/class=group colorgroup=group location=inside;&amp;nbsp; &amp;nbsp; * xaxis values=(0 to 3.25 by 0.5) labelattrs=(size=13) valueattrs=(size=13)&amp;nbsp; ;&amp;nbsp;&amp;nbsp;xaxis min=0 max=3.25 values=(0 0.5 1.0 1.5 2.0 2.5 3.0 )&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; labelattrs=(size=13)&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; valueattrs=(size=13);&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;yaxis&amp;nbsp; values=(0 to 0.2 by 0.05) label= "Probability" labelattrs=(size=13) valueattrs=(size=13);&amp;nbsp; &amp;nbsp; xaxis label='Years';&amp;nbsp;&amp;nbsp; &amp;nbsp;label T =&amp;nbsp; "Years"&amp;nbsp; &amp;nbsp;cif= "MACE";&amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;title h=12pt 'Probability of MACE by Optimal CT Predicted Probability Tertiles';&amp;nbsp; &amp;nbsp;&amp;nbsp; format group group.;run;&lt;BR /&gt;</description>
      <pubDate>Thu, 19 Dec 2024 16:39:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954177#M47729</guid>
      <dc:creator>J_Park</dc:creator>
      <dc:date>2024-12-19T16:39:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954230#M47730</link>
      <description>"The data attached is a mock up data as I can't send the actual data."&lt;BR /&gt;Where is your dataset? I don't see any attachment.</description>
      <pubDate>Fri, 20 Dec 2024 01:41:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954230#M47730</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-20T01:41:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954232#M47731</link>
      <description>&lt;P&gt;With using the builded-in sas dataset SASHELP.BMT as a sample dataset to test your code.&lt;/P&gt;
&lt;P&gt;I think I found where the problem is:&lt;/P&gt;
&lt;P&gt;You missed T variable in your code,check my original code.&lt;/P&gt;
&lt;PRE&gt;
data model1_tert2(keep= T Group eventstatus ); 
set sashelp.bmt;
rename status=eventstatus;
run;

proc lifetest data=model1_tert2  plots=cif(test ) notable  OUTCIF=cifnrm_out ;    
time T*eventstatus(0)/eventcode=1;  
strata Group/order=internal; 
run;

data time;
/*do t=0 to 3.0 by 0.5; */
do t=0 to 2500 by 500;
output;
end;
run;

proc sql;
create table temp as
select * from (select distinct Group from cifnrm_out),time
order by 1,2;
quit;

data test; 
set cifnrm_out temp(in=inb); 
&lt;STRONG&gt;by Group &lt;FONT color="#FF0000"&gt;T&lt;/FONT&gt;;   &lt;FONT color="#FF0000"&gt;/* &amp;lt;------- You missed the T variable*/&lt;/FONT&gt;&lt;/STRONG&gt;
retain temp; 
if first.Group then call missing(temp); 
if not missing(AtRisk) then temp=AtRisk; 
if inb then time_AtRisk=temp; 
keep Group T AtRisk CIF time_AtRisk ;
run;

&lt;/PRE&gt;
&lt;P&gt;Open dataset TEST,you could see the different value from different T.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1734659936255.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103244iC18BEC4E1A9A9342/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1734659936255.png" alt="Ksharp_0-1734659936255.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 01:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954232#M47731</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-20T01:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954363#M47732</link>
      <description>&lt;P&gt;OMG, I feel so stupid.&amp;nbsp; how can I miss the "T"?&amp;nbsp; Thank you soooooo much for your help!!!&amp;nbsp; Now it works great except one thing.&amp;nbsp; I wanted the xaxis values=(0 to 3.25 by 0.5) but it only shows 0, 1, 2, and 3.&amp;nbsp; I am not sure why.&amp;nbsp; Any insights?&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 20:13:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954363#M47732</guid>
      <dc:creator>J_Park</dc:creator>
      <dc:date>2024-12-20T20:13:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954393#M47733</link>
      <description>&lt;P&gt;Then plz post the sample dataset , so I think test it .&lt;/P&gt;
&lt;P&gt;Still using sas built-in dataset sashelp.bmt to test,and still not found any problem .&lt;/P&gt;
&lt;P&gt;Referring to the following code,maybe you could found where the problem is by yourself.&lt;/P&gt;
&lt;PRE&gt;proc lifetest data=sashelp.bmt plots=cif(test ) notable  OUTCIF=cifnrm_out ;
time t*status(0)/eventcode=1;
strata group/order=internal;
run;



data time;
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;do t=0 to 2500 by 100;&lt;/STRONG&gt;&lt;/FONT&gt;
 output;
end;
run;
proc sql;
create table temp as
select * from (select distinct Group from cifnrm_out),time order by 1,2;
quit;
data want;
 set cifnrm_out temp(in=inb);
 by Group t;
 retain temp;
 if first.Group then call missing(temp);
 if not missing(AtRisk) then temp=AtRisk;
 if inb then time_AtRisk=temp;
 keep Group t AtRisk CIF time_AtRisk ;
run;
options missing=' ';
proc sgplot data=want;
step x=T y=CIF/group=Group;
xaxistable time_AtRisk/class=group colorgroup=Group location=inside;
xaxis label='Disease-Free Survival Time' &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;values=(0 to 2500 by 100) fitpolicy=stagger; /*fitpolicy=none*/&lt;/STRONG&gt;&lt;/FONT&gt;
yaxis values=(0 to 1 by 0.2);
run;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1734763356835.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/103320i7F26AAEA5F34C4B7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1734763356835.png" alt="Ksharp_0-1734763356835.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2024 06:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954393#M47733</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-21T06:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954415#M47734</link>
      <description>Hello,&lt;BR /&gt;Thank you again for your response!&amp;nbsp; &amp;nbsp; I am attaching my code and the sample file.&amp;nbsp; &amp;nbsp; Thank you so much for your help!&lt;BR /&gt;&lt;BR /&gt;proc lifetest data=sample&amp;nbsp; plots=cif(test ) notable&amp;nbsp; OUTCIF=cifnrm_out ;&amp;nbsp; &amp;nbsp; &amp;nbsp;time T*eventstatus(0)/eventcode=1;strata Group/order=internal;&amp;nbsp;run;&lt;BR /&gt;&lt;BR /&gt;proc freq data = cifnrm_out;tables&amp;nbsp; group*event group*censored;run;&lt;BR /&gt;&lt;BR /&gt;data time;do t=0 to 3.0 by 0.5;&amp;nbsp;output;end;run;&lt;BR /&gt;proc sql;create table temp asselect * from (select distinct Group from cifnrm_out),time order by 1,2;quit;&lt;BR /&gt;data test;&amp;nbsp;set cifnrm_out temp(in=inb);&amp;nbsp;by Group t;&amp;nbsp;retain temp;&amp;nbsp;if first.Group then call missing(temp);&amp;nbsp;if not missing(AtRisk) then temp=AtRisk;&amp;nbsp;if inb then time_AtRisk=temp;&amp;nbsp;keep Group t AtRisk CIF time_AtRisk ;run;&lt;BR /&gt;proc freq data = test;tables&amp;nbsp; group*time_atrisk;run;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;proc format ;&amp;nbsp;value gp0&amp;nbsp; &amp;nbsp;= "&amp;lt;0.02"1&amp;nbsp; &amp;nbsp;= "0.02-0.03"2&amp;nbsp; &amp;nbsp;= "&amp;gt;0.03";quit;&lt;BR /&gt;options missing=' ';&lt;BR /&gt;proc sort data=test; by descending group; run;&lt;BR /&gt;proc sgplot data=test noborder;styleattrs datacontrastcolors=(darkred blue green);&amp;nbsp; step x=T y=cif /&amp;nbsp; group=group name='plaque'&amp;nbsp; lineattrs=(thickness=4 pattern = SOLID) ;&amp;nbsp; &amp;nbsp;keylegend 'plaque' /&amp;nbsp; title='Predicted Probability' location=outside position=bottom across=3&amp;nbsp; valueattrs=(size=12) TITLEATTRS=(size=12);&lt;BR /&gt;&amp;nbsp; xaxistable time_AtRisk/class=group colorgroup=group location=inside;&amp;nbsp; &amp;nbsp; xaxis values=(0 to 3 by 0.5) labelattrs=(size=13) valueattrs=(size=13)&amp;nbsp; ;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp;yaxis&amp;nbsp; values=(0 to 0.2 by 0.05) label= "Probability" labelattrs=(size=13) valueattrs=(size=13);&amp;nbsp; &amp;nbsp; xaxis label='Years';&amp;nbsp;&amp;nbsp; &amp;nbsp;label T =&amp;nbsp; "Years"&amp;nbsp; &amp;nbsp;cif= "MACE";&amp;nbsp; &amp;nbsp; &amp;nbsp;title h=12pt 'Probability of MACE by Optimal CT Predicted Probability Tertiles';&amp;nbsp; &amp;nbsp;&amp;nbsp;format group gp.;run;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 21 Dec 2024 16:58:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954415#M47734</guid>
      <dc:creator>J_Park</dc:creator>
      <dc:date>2024-12-21T16:58:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954429#M47735</link>
      <description>&lt;P&gt;Where is your attachment for SAMPLE dataset?&lt;/P&gt;
&lt;P&gt;And I noticed that you have TWO xaxis statements,why ? I think you should &lt;STRONG&gt;remove&lt;/STRONG&gt; the second xaxis statement.&lt;/P&gt;
&lt;PRE&gt;proc sgplot data=test noborder;
styleattrs datacontrastcolors=(darkred blue green);  
step x=T y=cif /  group=group name='plaque'  lineattrs=(thickness=4 pattern = SOLID) ;   
keylegend 'plaque' /  title='Predicted Probability' location=outside
                     position=bottom across=3  valueattrs=(size=12) TITLEATTRS=(size=12);

xaxistable time_AtRisk/class=group colorgroup=group location=inside;   
&lt;STRONG&gt;xaxis values=(0 to 3 by 0.5) labelattrs=(size=13) valueattrs=(size=13)  &lt;FONT color="#FF0000"&gt;fitpolicy=none&lt;/FONT&gt;  &lt;FONT color="#FF0000"&gt;label='Years' &lt;/FONT&gt;&lt;/STRONG&gt;  ;     
yaxis  values=(0 to 0.2 by 0.05) label= "Probability" labelattrs=(size=13) valueattrs=(size=13);   
&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;/* xaxis label='Years';    &amp;lt;--- Should get rid of it*/&lt;/STRONG&gt;&lt;/FONT&gt;
label T =  "Years"   cif= "MACE";     
title h=12pt 'Probability of MACE by Optimal CT Predicted Probability Tertiles';   
format group gp.;
run;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2024 01:36:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954429#M47735</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-12-22T01:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954434#M47736</link>
      <description>&lt;P&gt;Hope you can see the sample.csv file.&amp;nbsp; Thank you!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2024 02:53:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954434#M47736</guid>
      <dc:creator>J_Park</dc:creator>
      <dc:date>2024-12-22T02:53:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to plot cumulative incidence with number at risk from survival analysis with competing risk</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954435#M47737</link>
      <description>&lt;P&gt;I just ran your code and it worked!&amp;nbsp; &amp;nbsp;Thank you so much!!!&lt;/P&gt;</description>
      <pubDate>Sun, 22 Dec 2024 02:54:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/How-to-plot-cumulative-incidence-with-number-at-risk-from/m-p/954435#M47737</guid>
      <dc:creator>J_Park</dc:creator>
      <dc:date>2024-12-22T02:54:32Z</dc:date>
    </item>
  </channel>
</rss>

