<?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: Restricted Cubic Splines with Multinomial  Outcome in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/424924#M14647</link>
    <description>&lt;P&gt;First, &lt;A href="https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html" target="_self"&gt;you can create this plot by using the EFFECTPLOT statement&lt;/A&gt;. Add the statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;EFFECTPLOT FIT;&lt;/P&gt;
&lt;P&gt;to your PROC LOGISTIC call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, in your problem, the FIT, L, and U variables are the predicted values from a regression procedure. To plot them, it is not appropriate to use LOESS or PBSPLINE statements to&amp;nbsp;smooth the predicted values. Use the SERIES statement for the FIT curve and use the BAND statement for the L and U confidence limits:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select ModelANOVA ParameterEstimates SplineKnots;
proc logistic data=Sashelp.cars(where=(Origin in ('Asia' 'USA') &amp;amp; Type ^="Hybrid"));
  effect spl = spline(mpg_city / details naturalcubic basis=tpf(noint)                 
                               knotmethod=percentiles(5) );
   model Origin(event ='USA')= spl / selection=none;     /* fit model by using spline effects */
   output out=SplineOut predicted=Fit lower = l upper = u;    /* output predicted values for graphing */
   effectplot fit;  /* produce fit plot automatically */
run;

/* or produce fit plot manually by using predicted values in output data set */
proc sort data=SplineOut; by mpg_city; run;

proc sgplot data = splineout;
   band x = mpg_city lower=L upper=U;
   series x = mpg_city y = fit / curvelabel = "Predicted value";
   /* optional, uncomment if you want to overlay the upper/lower limits */
   /*
   series x = mpg_city y = U / curvelabel = "Upper CL";
   series x = mpg_city y = L / curvelabel = "Lower CL";
   */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2018 14:47:06 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-01-04T14:47:06Z</dc:date>
    <item>
      <title>Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423823#M14618</link>
      <description>&lt;P&gt;I had been generating spline curves for a dichotomous outcome, but now I am looking at a 3 level outcome, although then ordinal scale is not proportional. Mainly concerned with generating curves for 2 vs 0, and 1 vs 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the code I had been using:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ods select ModelANOVA ParameterEstimates SplineKnots;&lt;BR /&gt;proc logistic data=HEERDT.VPICU;&lt;BR /&gt;  effect spl = spline(Ind_DBP1 / details naturalcubic basis=tpf(noint)                 &lt;BR /&gt;                               knotmethod=percentiles(5) );&lt;BR /&gt;   model Vent24 (event ='0')= spl / selection=none;     /* fit model by using spline effects */&lt;BR /&gt;   output out=SplineOut predicted=Fit lower = l upper = u;    /* output predicted values for graphing */&lt;BR /&gt;   where CPB=1;&lt;BR /&gt;   Title 'Probability of Failed Extubation by 24h: Spline Adjusted Model';&lt;BR /&gt;run;&lt;BR /&gt;&lt;BR /&gt;proc sgplot data = splineout;&lt;BR /&gt;loess x = ind_dbp1 y = fit/nomarkers curvelabel = "Predicted value" nolegclm nolegfit;&lt;BR /&gt;loess x = ind_dbp1 y = u/nomarkers   curvelabel = "Upper CI"        nolegclm nolegfit ;&lt;BR /&gt;loess x = ind_dbp1 y = l/nomarkers   curvelabel = "Lower CI"        nolegclm nolegfit;&lt;BR /&gt;run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;This is fine for binary outcomes and I have been able to generate curves of quadratic functions of the continuous &amp;nbsp;exposure&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Ind_DBP1&lt;/PRE&gt;&lt;P&gt;I have tried entering "&amp;nbsp;link=glogit" within the model statement and stated that the outcome has a reference value if 0 &amp;nbsp;rather than stating a particulate value for the event.&lt;BR /&gt;p values come out as highly significant for the knot placements but I get the following error message when I try too plot a graph:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROCEDURE SGPLOT used (Total process time):&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;real time 0.20 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;cpu time 0.14 seconds&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The number of observations of the LOESS plot (5313) exceeds the limit of 5000. Specify the LOESSMAXOBS option of the ODS&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;GRAPHICS statement to override the limit.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The number of observations of the LOESS plot (5313) exceeds the limit of 5000. Specify the LOESSMAXOBS option of the ODS&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;GRAPHICS statement to override the limit.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: The number of observations of the LOESS plot (5313) exceeds the limit of 5000. Specify the LOESSMAXOBS option of the ODS&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;GRAPHICS statement to override the limit.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS1' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS2' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: A blank graph is produced. For possible causes, see the graphics template language documentation.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS1' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS2' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: A blank graph is produced. For possible causes, see the graphics template language documentation.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS1' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: The LoessPlot statement named 'LOESS2' will not be drawn because one or more of the required arguments were not supplied.&lt;/DIV&gt;&lt;DIV class="sasWarning"&gt;WARNING: A blank graph is produced. For possible causes, see the graphics template language documentation.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: There were 5313 observations read from the data set WORK.SPLINEOUT.&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;81&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;82 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;95&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christos&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 02:37:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423823#M14618</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2017-12-28T02:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423829#M14619</link>
      <description>&lt;H5 class="xis-optionNoCategory"&gt;Loess is expensive, and there are default limits on the number of observations for loess fit.&amp;nbsp; Either specify the option below in the ODS GRAPHICS statement or use PBSPLINE instead of LOESS.&lt;/H5&gt;
&lt;H5 class="xis-optionNoCategory"&gt;&amp;nbsp;&lt;/H5&gt;
&lt;H5 class="xis-optionNoCategory"&gt;&lt;A class="ng-scope" tabindex="0" href="http://documentation.sas.com/?docsetId=odsug&amp;amp;docsetTarget=p0kroq43yu0lspn16hk1u4c65lti.htm&amp;amp;docsetVersion=9.4&amp;amp;locale=en#p0kssk9r8oz909n1o1xjki7c2a5t" rel="nofollow" data-docset-id="odsug" data-docset-version="9.4" data-original-href="#p0kssk9r8oz909n1o1xjki7c2a5t"&gt;LOESSOBSMAX=&lt;SPAN class="xis-userSuppliedValue"&gt;n&lt;/SPAN&gt;&lt;/A&gt;&lt;/H5&gt;
&lt;P class="xis-shortDescriptionNoCategory"&gt;specifies an upper limit for the number of observations that can be used with a loess plot.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 03:53:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423829#M14619</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-12-28T03:53:46Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423891#M14620</link>
      <description>&lt;P&gt;I changed it to this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data=HEERDT.VPICU;&lt;BR /&gt;effect spl = spline(Ind_DBP1 / details naturalcubic basis=tpf(noint) knotmethod=percentiles(5) );&lt;BR /&gt;model VP24_VasoNE_012(event ='2')= spl / link=glogit ct covb clodds=wald selection=none; /* fit model by using spline effects */&lt;BR /&gt;output out=SplineOut predicted=Fit lower = l upper = u; /* output predicted values for graphing */&lt;BR /&gt;where CPB=1;&lt;BR /&gt;Title '';&lt;BR /&gt;run;&lt;BR /&gt;proc sgplot data = splineout;&lt;BR /&gt;PBSPLINE x = ind_dbp1 y = fit/nomarkers;&lt;BR /&gt;PBSPLINE x = ind_dbp1 y = u/nomarkers;&lt;BR /&gt;PBSPLINE = ind_dbp1 y = l/nomarkers;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The screenshot accompanying it seems meaningless.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm certain that there is an effect, because a quadratic works very well at outcome level 3.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Enclosed is an additional screenshot showing the covariate matrix when reference level for the outcome is specified as '0'.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 13:29:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423891#M14620</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2017-12-28T13:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423894#M14621</link>
      <description>&lt;P&gt;Not sure if any of this screenshots went through, trying again, but using the "add photo" option.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-12-28 at 8.16.52 AM.png"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Screen Shot 2017-12-28 at 8.16.52 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-12-28 at 8.22.32 AM.png"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Screen Shot 2017-12-28 at 8.22.32 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 13:31:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423894#M14621</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2017-12-28T13:31:20Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423895#M14622</link>
      <description>&lt;P&gt;Not sure if any of this screenshots went through, trying again, but using the "add photo" option.&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-12-28 at 8.16.52 AM.png"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Screen Shot 2017-12-28 at 8.16.52 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-12-28 at 8.22.32 AM.png"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Screen Shot 2017-12-28 at 8.22.32 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 13:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423895#M14622</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2017-12-28T13:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423899#M14624</link>
      <description>&lt;P&gt;When I remove the link =glogit statement, the output looks more like a spline, but I cant tell from this what level of the outcome is specified as without link=glogit &amp;nbsp;I don't see how SAS knows what levels we are comparing to what?&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-12-28 at 8.33.06 AM.png"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Screen Shot 2017-12-28 at 8.33.06 AM.png" /&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screen Shot 2017-12-28 at 8.33.15 AM.png"&gt;&lt;img src="https://communities.sas.com/skins/images/70F8802BAA6255D55FBEC62A8226FB10/responsive_peak/images/image_not_found.png" alt="Screen Shot 2017-12-28 at 8.33.15 AM.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Dec 2017 13:37:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/423899#M14624</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2017-12-28T13:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/424924#M14647</link>
      <description>&lt;P&gt;First, &lt;A href="https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html" target="_self"&gt;you can create this plot by using the EFFECTPLOT statement&lt;/A&gt;. Add the statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp;EFFECTPLOT FIT;&lt;/P&gt;
&lt;P&gt;to your PROC LOGISTIC call.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second, in your problem, the FIT, L, and U variables are the predicted values from a regression procedure. To plot them, it is not appropriate to use LOESS or PBSPLINE statements to&amp;nbsp;smooth the predicted values. Use the SERIES statement for the FIT curve and use the BAND statement for the L and U confidence limits:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select ModelANOVA ParameterEstimates SplineKnots;
proc logistic data=Sashelp.cars(where=(Origin in ('Asia' 'USA') &amp;amp; Type ^="Hybrid"));
  effect spl = spline(mpg_city / details naturalcubic basis=tpf(noint)                 
                               knotmethod=percentiles(5) );
   model Origin(event ='USA')= spl / selection=none;     /* fit model by using spline effects */
   output out=SplineOut predicted=Fit lower = l upper = u;    /* output predicted values for graphing */
   effectplot fit;  /* produce fit plot automatically */
run;

/* or produce fit plot manually by using predicted values in output data set */
proc sort data=SplineOut; by mpg_city; run;

proc sgplot data = splineout;
   band x = mpg_city lower=L upper=U;
   series x = mpg_city y = fit / curvelabel = "Predicted value";
   /* optional, uncomment if you want to overlay the upper/lower limits */
   /*
   series x = mpg_city y = U / curvelabel = "Upper CL";
   series x = mpg_city y = L / curvelabel = "Lower CL";
   */
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 14:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/424924#M14647</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-04T14:47:06Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/424938#M14648</link>
      <description>&lt;P&gt;Thank you Rick:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There seems to be many ways to do this, although I'm not sure how I can tell which is"more correct" (If such a thing exists).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why do you think this approach is better and what are the pros / cons? Was my previous approach better suited for other applications?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was particularly interested in finding a way to run restricted cubic splines rather than just splines. Whilst I understand conceptually what this is, I have not found a way to do this in SAS yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christos&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 15:13:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/424938#M14648</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-01-04T15:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/424975#M14649</link>
      <description>&lt;P&gt;&amp;gt; &lt;EM&gt;There &lt;/EM&gt;seems&lt;EM&gt; to be many ways to do this, although I'm not sure how I can tell which is"more correct" (If such a thing exists).&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes, there are many ways to do this and other tasks. Of the two ways I showed, neither&amp;nbsp;is&amp;nbsp; "more correct," but the EFFECTPLOT statement is definitely easier and requires less effort.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;gt; &lt;EM&gt;Why do you think this approach is better and what are the &lt;/EM&gt;pros / cons&lt;EM&gt;? Was my previous approach better suited for other applications?&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This approach is better because the curves/band represent actually predicted values from a statistical model. If you use a loess or penalized b-spline to smooth the predicted values, you obtain a curve that is not the one predicted by the model. In many cases, a loess or spline curve does not pass through the predicted values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;gt; &lt;EM&gt;I was particularly interested in finding a way to run restricted cubic splines rather than just splines. Whilst I understand conceptually what this is, I have not found a way to do this in SAS yet.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't know what you mean by "to do this in SAS." What is&amp;nbsp;"this"? You must have used &lt;A href="https://blogs.sas.com/content/iml/2017/04/19/restricted-cubic-splines-sas.html" target="_self"&gt;my article on regression splines&lt;/A&gt;&amp;nbsp;to write your code. The article contains links to &lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_introcom_sect020.htm" target="_self"&gt;the SAS documentation on splines.&lt;/A&gt;&amp;nbsp;SAS supports many kinds of splines. &lt;A href="http://support.sas.com/documentation/cdl/en/statug/68162/HTML/default/viewer.htm#statug_transreg_details03.htm" target="_self"&gt;The documentation for PROC TRANSREG also contains details and examples.&lt;/A&gt;&amp;nbsp;If you&amp;nbsp;can specify the spline basis that you want to use, someone on this community can show you how to use that basis in a regression.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 16:37:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/424975#M14649</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-04T16:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/425003#M14650</link>
      <description>&lt;P&gt;Regarding "doing this":&lt;/P&gt;&lt;P&gt;Sorry about not being specific.&lt;/P&gt;&lt;P&gt;I was referring to "Restricted Cubic Splines". I have seen this alot in the literature in my field and am including a paper with an example &amp;nbsp;where they used Stata. (Venkatesan et al).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It seems as though they were able to:&lt;/P&gt;&lt;P&gt;1) Partially dismiss the effects of instability (due to fewer entries) &amp;nbsp;at the extreme ends of the independent variable of interest.&lt;/P&gt;&lt;P&gt;2) Assign a definitive trough value, and generate OR's in reference to this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't remember reading your article. One of my friends suggested using this code a few months ago for a poster I was presenting.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess at the end of the day I need to be able to establish a curve that is publication worthy and that I'll be able to defend.&lt;/P&gt;&lt;P&gt;Will look at your article.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Much Appreciated,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christos&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 17:45:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/425003#M14650</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-01-04T17:45:06Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/425030#M14651</link>
      <description>Loess output and Series output looks the same even though the shading and colours are different . Can only add one file at a time to this message so will send the series output in the next message.</description>
      <pubDate>Thu, 04 Jan 2018 19:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/425030#M14651</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-01-04T19:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/425036#M14654</link>
      <description>&lt;P&gt;This is the second &amp;nbsp;output where we used series instead of loess in the proc subplot statement .&lt;/P&gt;&lt;P&gt;Can anyone see whether the curve is different at all?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2018 19:55:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/425036#M14654</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-01-04T19:55:44Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/425052#M14655</link>
      <description>&lt;P&gt;Yes, if the X values are closely spaced and the Y values are not too wild, you will often obtain a loess curve that looks very similar to a series plot. My point, however, is that it is not statistically appropriate to put a smoother through predicted&amp;nbsp;values.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For one thing, the loess curve is actually one of a family of curves that are parameterized by a smoothing parameter. The curve that is displayed is chosen to minimize a system of local regression fits, assuming that the points are data with IID errors.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The following example shows data for which the "best" loess curve does not pass anywhere near the fitted points.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Fit;
input x y @@;
datalines;
0 0   1 5   3 5   4 0   5 5
;

proc sgplot data=Fit;
series x=x y=y / lineattrs=(color=red);
loess x=x y=y;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 05 Jan 2018 21:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/425052#M14655</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-05T21:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/427587#M14721</link>
      <description>&lt;P&gt;Rick:&lt;/P&gt;&lt;P&gt;Hope you are enjoying the weekend.&lt;/P&gt;&lt;P&gt;I am struggling with getting figures for the adjusted models. I guess with out smoothing the curves, the edges will be erratic but I can't really &amp;nbsp;present these.&lt;/P&gt;&lt;P&gt;What if anything should I consider doing with this adjusted model in order to make it meaningful or presentable as a figure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Christos&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 00:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/427587#M14721</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-01-15T00:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/427646#M14724</link>
      <description>&lt;P&gt;The parameter estimates indicate that you are including multiple covariates in the model (age, BMI, etc). You need to use the EFFECTPLOT SLICEFIT statement to create a sliced fit plot. See&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/12/18/visualize-multivariate-regression-models-by-slicing-continuous-variables.html" target="_self"&gt;Visualize multivariate regression models by slicing continuous variables&lt;/A&gt;&amp;nbsp; (see the 2nd graph, which&amp;nbsp;looks like yours)&lt;/P&gt;
&lt;P&gt;If for some reason you can't use the EFFECTPLOT statement, see&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2017/12/20/create-sliced-fit-plot-sas.html" target="_self"&gt;How to create a sliced fit plot in SAS&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jan 2018 14:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/427646#M14724</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-15T14:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/428210#M14766</link>
      <description>&lt;P&gt;Rick:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for the link and suggestions. I have been doing a logistic regression with only one continuous variable being a spline.&lt;/P&gt;&lt;P&gt;The Univariate &amp;nbsp;code is as follows:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select ModelANOVA ParameterEstimates SplineKnots;
proc logistic data=HEERDT.VPICU_label;
  effect spl = spline(Ind_DBP1 / details naturalcubic basis=tpf(noint)                 
                               knotmethod=percentiles(5) ); /* fit model by using spline effects */
  model Vent__240(reference ='0')= spl / ct covb clodds=wald   selection=none;
  output out=SplineOut  predicted=Fit lower = l upper = u;    /* output predicted values for graphing */
  effectplot fit;
run;
proc sort data =SplineOut; by Ind_DBP1; run; 
proc sgplot data = SplineOut;
band x=Ind_DBP1 lower=L upper=U;
series x = Ind_DBP1 y = fit/ curvelabel = "Predicted value";
series x = Ind_DBP1 y = u/ curvelabel = "Upper CI";
series x = Ind_DBP1 y = l/ curvelabel = "Lower CI";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I tried some of your suggestions, but since you were using gym, and only had single lines rather than 95% CI's as well, I got a bit confused and was not able to get it to work.&lt;/P&gt;&lt;P&gt;Initially I just added multiple covariates, ands this worked fine when running loess in proc sgplot, but with series there were alot of jagged lines for all the reasoned you had mentioned.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried various iterations of slice fit:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select ModelANOVA ParameterEstimates SplineKnots;
proc logistic data=HEERDT.VPICU_label;
  effect spl = spline(Ind_DBP1 / details naturalcubic basis=tpf(noint)                 
                               knotmethod=percentiles(5) ); /* fit model by using spline effects */
  class Sex(ref="F")Race_d (ref="C")/param=ref;
  model Vent__240(reference ='0')= spl Sex Age 
/*    Race_d CABG ACEI ARB Statin1 BMI NIDDM1  BB  pre_Cr pre_K*/
/ ct covb clodds=wald   selection=none;
  output out=Splineout  predicted=Fit lower = l upper = u;    /* output predicted values for graphing */
  effectplot slicefit / at (Sex ='F' Age=50);
run;
proc sort data =SplineOut; by Ind_DBP1; run;
 
proc sgplot data = SplineOut ;
band x=Ind_DBP1 lower=L upper=U;
series x = Ind_DBP1 y = fit/ curvelabel = "Predicted value";
series x = Ind_DBP1 y = u/ curvelabel = "Upper CI";
series x = Ind_DBP1 y = l/ curvelabel = "Lower CI";
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The only difference I see between your examples and what I am modeling is that you had a continuous dependent variable and that I was generating predicted probabilities out of a logistic regression. And that I was plotting confidence intervals, Adding anything my univariate model created jagged edges because this was being modeled on the actual values I guess rather than an an estimate of what these should be by the model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If this was not entertaining enough, I am also trying to get a way to &amp;nbsp;get odds ratios for pr-specifiued levels of the &amp;nbsp;continuous exposure that is splined, comparing the odds of that level to the mode. It seems to be easy in Stada and R but not SAS. Any idea ?&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jan 2018 23:04:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/428210#M14766</guid>
      <dc:creator>ChristosK</dc:creator>
      <dc:date>2018-01-16T23:04:04Z</dc:date>
    </item>
    <item>
      <title>Re: Restricted Cubic Splines with Multinomial  Outcome</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/428331#M14773</link>
      <description>&lt;P&gt;Here's an example for&amp;nbsp;PROC LOGISTIC to get you started.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data cars;    /* create example data */
set sashelp.cars;
where type^='Hybrid' &amp;amp; cylinders in (4,6,8);
run;
 
ods graphics / attrpriority=none;     /* groups determine symbols and line patterns */
 
proc logistic data=cars;
effect spl = spline(mpg_city / details naturalcubic basis=tpf(noint)                 
                               knotmethod=percentiles(5) ); 
class cylinders type / param=ref;
model origin = spl cylinders type weight engineSize;
effectplot slicefit (X=mpg_city) / clm ilink 
                                   at(cylinders='4'
                                      type='Sedan'
                                      weight=MEAN
                                      engineSize=MEAN);
oddsratio cylinders;
oddsratio type;
quit;

 &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This is complicated stuff, so you might need to reread the articles and&amp;nbsp;&lt;A href="http://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetTarget=statug_introcom_sect027.htm&amp;amp;docsetVersion=14.3&amp;amp;locale=en#statug.introcom.efpl_at" target="_self"&gt;the documentation of the EFFECTPLOT statement&lt;/A&gt;&amp;nbsp;several times. Also, pay attention to the SAS log. I think you are getting notes that tell you that some of your PROC LOGISTIC syntax is not valid. For example, you are currently fitting&amp;nbsp;a cumulative logistic model, which does not support the REF= and CTABLE options.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your remaining questions seem to be statistical, not graphical. I suggest you close out this thread and if you have questions about odds ratios and logistic models, open a new thread in the Statistical Procedures Community. Good luck!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 11:47:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Restricted-Cubic-Splines-with-Multinomial-Outcome/m-p/428331#M14773</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-01-17T11:47:38Z</dc:date>
    </item>
  </channel>
</rss>

