SAS survival_2

 

walldisplay = (fill)不显示右|上坐标轴的线

viewmin = 

viewmax = 指定显示在plot中的值的范围

linearopts = () 坐标轴是数值型时,设置一些选项

tickvaluefitpolicy = 避免坐标轴冲突

 

ods trace on;
ods output Survivalplot=GTL_GS_SurvivalPlotData;
ods graphics / reset imagename='Survival-LifeTest';
proc lifetest data=sashelp.BMT plots=survival(atrisk=0 to 2500 by 100);
   time T * Status(0);
   strata Group / test=logrank adjust=sidak;
   run;
ods trace off;

proc format;
  value aml
  3 = 'AML-Low'
  2 = 'AML-High'
  1 = 'All';
run;
 
ods html;
          
proc template;            
   define style plot1style;                  
   parent=styles.tlfrtf;                  
   end;                  
   define statgraph ptemplate1;                  
   begingraph / datacontrastcolors=( red green blue darkpurple ) datalinepatterns=(solid ) designwidth=8.9in designheight=5.0in border=false;                  
   entrytitle textattrs=GraphTitleText(family='Courier New' size=8pt ) "Not Received";                  
   layout lattice / rows=2 columns=1 rowweights=(0.75 0.25) columndatarange = union rowgutter = 0;                  
       layout overlay / walldisplay = (fill) xaxisopts= ( label='Time (days)' labelattrs=(family='Courier New' size=8pt ) 
                    linearopts=(/*tickvaluelist=( 0 3 )*/
                    tickvaluefitpolicy = staggerthin)) 
                    yaxisopts=( labelattrs=(family='Courier New' size=8pt weight = bold)  
                    label="Cumulative Incidence of Discharge" labelattrs=(family='Courier New' size=8pt) 
                    linearopts=(viewmin=0 viewmax=1));                  
           stepplot x = time y = survival /group = stratum name="step";                  
           scatterplot x = time y = censored /group = stratum name="scat" legendlabel="Censored" markerattrs=(symbol=plus) ;                  
       layout gridded / rows=2 columns=2 autoalign=( topleft);                  
           entry halign=left "Log-Rank 0.0000" / valign=top textattrs=(family='Courier New' size=8pt) ;
        entry halign=left "Log-Rank 0.1" / valign=top textattrs=(family='Courier New' size=8pt) ; 
        entry halign=left "Log-Rank 1" / valign=top textattrs=(family='Courier New' size=8pt) ; 
       endlayout;                  
       endlayout;                  
       layout overlay / walldisplay=none yaxisopts=(display=none) xaxisopts=(display=none) ;                  
           entry halign = left "Number of Subjects at Risk"/valign = bottom textattrs = (family='Courier New' size=8pt) pad=(top=5px) ;                  
           innermargin/align=bottom pad=(top=5px) separator=false;                  
               blockplot x = tatrisk block = atrisk / class = stratumnum display=(values label) repeatedvalues=true 
                                                valueattrs=(family='Courier New' size=8pt) labelattrs=(family='Courier New' size=8pt)
                                                    VALUEHALIGN=start;                  
           endinnermargin;                  
           discretelegend 'step' /opaque=false border=false halign=center valign=bottom displayclipped=true across=3 
                            order=rowmajor location=outside valueattrs=(family='Courier New' size=8pt);                                   
       endlayout;                  
   endlayout;                  
   endgraph;                  
   end;                  
run;  
 
proc sgrender data = GTL_GS_SurvivalPlotData template = ptemplate1;
format stratumnum aml.;
run;

 

 

 

posted @ 2021-10-06 10:12  Iving  阅读(284)  评论(0编辑  收藏  举报