<?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: Kaplan meier plot offsetmin not working in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Kaplan-meier-plot-offsetmin-not-working/m-p/716863#M221633</link>
    <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the "&amp;lt;&amp;gt;" to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "&amp;lt;/&amp;gt;" icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also share some data using the plot and the code submitted to actually generate the plot.&lt;/P&gt;</description>
    <pubDate>Thu, 04 Feb 2021 18:04:01 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-02-04T18:04:01Z</dc:date>
    <item>
      <title>Kaplan meier plot offsetmin not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Kaplan-meier-plot-offsetmin-not-working/m-p/716859#M221630</link>
      <description>&lt;P&gt;I want to shift the x axis to origin&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc template ;
define statgraph Stat.Lifetest.Graphics.ProductLimitSurvival2;
   dynamic NStrata xName plotAtRisk plotCensored plotCL plotHW plotEP labelCL labelHW labelEP maxTime xtickVals xtickValFitPol
      rowWeights method StratumID classAtRisk plotTest GroupName Transparency SecondTitle TestName pValue _byline_ _bytitle_
      _byfootnote_;
   BeginGraph;
      if (NSTRATA=1)
         if (EXISTS(STRATUMID))
            entrytitle &amp;amp;titletext1;
         else
            entrytitle &amp;amp;titletext0;
         endif;
         entrytitle "xyz2" / textattrs=GRAPHVALUETEXT;
         layout lattice / rows=2 rowweights=ROWWEIGHTS columndatarange=union rowgutter=10;
            cell;
               layout overlay / xaxisopts=(shortlabel=XNAME offsetmin=0 linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS 
                  tickvaluefitpolicy=XTICKVALFITPOL)) yaxisopts=(label="&amp;amp;yaxis" shortlabel="Survival" offsetmin=0 linearopts=(
                  viewmin=0 viewmax=1 tickvaluelist=(0 .2 .4 .6 .8 1.0)));
                  if (PLOTHW=1 AND PLOTEP=0)
                     bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
                        GRAPHCONFIDENCE name="HW" legendlabel=LABELHW;
                  endif;
                  if (PLOTHW=0 AND PLOTEP=1)
                     bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
                        GRAPHCONFIDENCE name="EP" legendlabel=LABELEP;
                  endif;
                  if (PLOTHW=1 AND PLOTEP=1)
                     bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
                        GRAPHDATA1 datatransparency=.55 name="HW" legendlabel=LABELHW;
                     bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
                        GRAPHDATA2 datatransparency=.55 name="EP" legendlabel=LABELEP;

 

                  endif;
                  if (PLOTCL=1)
                     if (PLOTHW=1 OR PLOTEP=1)
                        bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false modelname="Survival" display=(
                           outline) outlineattrs=GRAPHPREDICTIONLIMITS name="CL" legendlabel=LABELCL;
                     else
                        bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false modelname="Survival" fillattrs=
                           GRAPHCONFIDENCE name="CL" legendlabel=LABELCL;
                     endif;
                  endif;
                  stepplot y=SURVIVAL x=TIME / name="Survival" rolename=(_tip1=ATRISK _tip2=EVENT) tiplabel=(_tip1="Number at Risk"
                     _tip2="Observed Events") tip=(x y _tip1 _tip2) legendlabel="Survival";

                  if (PLOTCENSORED=1)
                     scatterplot y=CENSORED x=TIME / markerattrs=(symbol=plus) tiplabel=(y="Survival Probability") name="Censored"
                        legendlabel="Censored";
                  endif;
                  if (PLOTCL=1 OR PLOTHW=1 OR PLOTEP=1)
                     discretelegend "Censored" "CL" "HW" "EP" / location=outside halign=center;
                  else
                     if (PLOTCENSORED=1)
                        discretelegend "Censored" / location=inside autoalign=(topright bottomleft);
                     endif;
                  endif;
               endlayout;
            endcell;
            cell;
               layout overlay / walldisplay=none xaxisopts=(display=none);
                  axistable x=TATRISK value=ATRISK / display=(label) valueattrs=(size=7pt);
				   drawtext  'Number at Risk' / x=3 y=20 width=9;
               endlayout;
            endcell;
         endlayout;
      else
         entrytitle &amp;amp;titletext1;
         if (EXISTS(SECONDTITLE))
            entrytitle SECONDTITLE / textattrs=GRAPHVALUETEXT;
         endif;
         layout lattice / rows=2 rowweights=ROWWEIGHTS columndatarange=union rowgutter=10;
            cell;
               layout overlay / xaxisopts=(shortlabel=XNAME offsetmin=0 linearopts=(viewmax=MAXTIME tickvaluelist=XTICKVALS 
                  tickvaluefitpolicy=XTICKVALFITPOL)) yaxisopts=(label="&amp;amp;yaxis." shortlabel="Survival" offsetmin=0 linearopts=(
                  viewmin=0 viewmax=1 tickvaluelist=(0 .2 .4 .6 .8 1.0)));
                  if (PLOTHW=1)
                     bandplot LimitUpper=HW_UCL LimitLower=HW_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
                        modelname="Survival" datatransparency=Transparency;
                  endif;
                  if (PLOTEP=1)
                     bandplot LimitUpper=EP_UCL LimitLower=EP_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
                        modelname="Survival" datatransparency=Transparency;
                  endif;
                  if (PLOTCL=1)
                     if (PLOTHW=1 OR PLOTEP=1)
                        bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
                           modelname="Survival" display=(outline) outlineattrs=(pattern=ShortDash);
                     else
                        bandplot LimitUpper=SDF_UCL LimitLower=SDF_LCL x=TIME / displayTail=false group=STRATUM index=STRATUMNUM
                           modelname="Survival" datatransparency=Transparency;
                     endif;
                  endif;

 

                  stepplot y=SURVIVAL x=TIME / group=STRATUM index=STRATUMNUM name="Survival" rolename=(_tip1=ATRISK _tip2=EVENT)
                     tiplabel=(_tip1="Number at Risk" _tip2="Observed Events") tip=(x y _tip1 _tip2);
                  if (PLOTCENSORED=1)
                     scatterplot y=CENSORED x=TIME / group=STRATUM index=STRATUMNUM tiplabel=(y="Survival Probability") markerattrs
                        =(symbol=plus);
                  endif;
                  DiscreteLegend "Survival" / title=GROUPNAME location=outside ;
                  if (PLOTCENSORED=1)
                     if (PLOTTEST=1)
                        layout gridded / rows=2 autoalign=(TOPRIGHT ) border=false BackgroundColor=
                           GraphWalls:Color Opaque=true;
                           entry "+ Censored";
                           if (PVALUE &amp;lt; .0001)
                              entry TESTNAME " p " eval (PUT(PVALUE, PVALUE6.4));
                           else
                              entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
                           endif;
                        endlayout;
                     else
                        layout gridded / rows=1 autoalign=(TOPRIGHT ) border=false BackgroundColor=
                           GraphWalls:Color Opaque=true;
                           entry "+ Censored";
                        endlayout;
                     endif;
                  else
                     if (PLOTTEST=1)
                        layout gridded / rows=1 autoalign=(TOPRIGHT BOTTOMLEFT TOP BOTTOM) border=true BackgroundColor=
                           GraphWalls:Color Opaque=true;
                           if (PVALUE &amp;lt; .0001)
                              entry TESTNAME " p " eval (PUT(PVALUE, PVALUE6.4));
                           else
                              entry TESTNAME " p=" eval (PUT(PVALUE, PVALUE6.4));
                           endif;
                        endlayout;
                     endif;
                  endif;
               endlayout;
            endcell;
            cell;
               layout overlay / walldisplay=none xaxisopts=(display=none);
                  axistable x=TATRISK value=ATRISK / display=(label) valueattrs=(size=7pt) class=CLASSATRISK colorgroup=CLASSATRISK ;
 				  drawtext 'Number at Risk' / x=3 y=55 width=9 rotate= 90;
               endlayout;
            endcell;
         endlayout;
      endif;
      if (_BYTITLE_)
         entrytitle _BYLINE_ / textattrs=GRAPHVALUETEXT;
      else
         if (_BYFOOTNOTE_)
            entryfootnote halign=left _BYLINE_;
         endif;
      endif;
   EndGraph;
end;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I have set offsetmin to 0 in&amp;nbsp;xaxisopts ,&amp;nbsp;but&amp;nbsp;it doesn't work. Any other way to do it/?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 17:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Kaplan-meier-plot-offsetmin-not-working/m-p/716859#M221630</guid>
      <dc:creator>riyaaora275</dc:creator>
      <dc:date>2021-02-04T17:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Kaplan meier plot offsetmin not working</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Kaplan-meier-plot-offsetmin-not-working/m-p/716863#M221633</link>
      <description>&lt;P&gt;Doesn't work is awful vague.&lt;BR /&gt;&lt;BR /&gt;Are there errors in the log?: Post the code and log in a code box opened with the "&amp;lt;&amp;gt;" to maintain formatting of error messages.&lt;BR /&gt;&lt;BR /&gt;No output? Post any log in a code box.&lt;BR /&gt;&lt;BR /&gt;Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: &lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the "&amp;lt;/&amp;gt;" icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should also share some data using the plot and the code submitted to actually generate the plot.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 18:04:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Kaplan-meier-plot-offsetmin-not-working/m-p/716863#M221633</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-02-04T18:04:01Z</dc:date>
    </item>
  </channel>
</rss>

