<?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: visualization of proc logistic using restricted cubic spline in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/visualization-of-proc-logistic-using-restricted-cubic-spline/m-p/772662#M37767</link>
    <description>&lt;P&gt;Yes,&amp;nbsp; this occurs because of the covariates in the model, as explained in the article, &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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same article shows how to fix this problem. Basically, you do not want to use the SplineOut data set. Instead, you want to construct a data set that has a range of WITH6 values and uses a specified constant for the other covariates. Generally, the mean is used for the continuous variables, such as Age, and reference levels are used for the classification variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For many models, you can use the EFFECTPLOT statement in the procedure or in PROC PLM for this. However, it might be that spline effects are not supported in the EFFECTPLOT statement. In that case, you can construct the scoring data yourself, as shown in the article, &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>Thu, 07 Oct 2021 10:04:06 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2021-10-07T10:04:06Z</dc:date>
    <item>
      <title>visualization of proc logistic using restricted cubic spline</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/visualization-of-proc-logistic-using-restricted-cubic-spline/m-p/772645#M37766</link>
      <description>&lt;P&gt;Hey all.&lt;/P&gt;&lt;P&gt;I am a very beginner at statistics and SAS program and have difficulties in presenting my study.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to make a graph: x=years, y= "adjusted" Odds Ratio (reference": year1 data) and a band of 95%confidence intervals.&lt;/P&gt;&lt;P&gt;I read some manuals and blogs but kept failing it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't know how to set "years1 data" as my reference,&amp;nbsp;and why my graph is jagged after covariate adjustment.&lt;/P&gt;&lt;P&gt;here are my codes and graph.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks.&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;PROC SORT DATA=CM.POSTMP OUT=TEST;
BY WITH6; RUN; /*WITH6 is my independent variable(years)*/&lt;BR /&gt;
ods select ANOVA ParameterEstimates SplineKnots;
proc LOGISTIC data=TEST;
   effect spl = spline(WITH6/ NATURALCUBIC details basis=tpf(noint) );
   CLASS EDU_GR(REF='1') MARRIAGE_GR(REF='1') WORK_GR(REF='0') INCOME_Q(REF='1') SMOKE_GR(REF='0') ALCOHOL_GR(REF='0') MET_GP(REF='1') B12(REF='1') /PARAM=REF;
	model HTN_SYS(EVENT="1")= spl AGE EDU_GR MARRIAGE_GR WORK_GR INCOME_Q SMOKE_GR ALCOHOL_GR MET_GP BMI B12 / selection=none;   /*HTN_sys is binary*/
   output out=SplineOut predicted=Fit;
quit;
 
title "Restricted Cubic Spline Regression";
proc sgplot data=SplineOut noautolegend;
   scatter x=WITH6 y=HTN_SYS;
   series x=WITH6 y=Fit / lineattrs=(thickness=2 color=red);
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Prankerd_0-1633596850379.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/64437i231C2678B3CF579C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Prankerd_0-1633596850379.png" alt="Prankerd_0-1633596850379.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>Thu, 07 Oct 2021 08:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/visualization-of-proc-logistic-using-restricted-cubic-spline/m-p/772645#M37766</guid>
      <dc:creator>Prankerd</dc:creator>
      <dc:date>2021-10-07T08:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: visualization of proc logistic using restricted cubic spline</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/visualization-of-proc-logistic-using-restricted-cubic-spline/m-p/772662#M37767</link>
      <description>&lt;P&gt;Yes,&amp;nbsp; this occurs because of the covariates in the model, as explained in the article, &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;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The same article shows how to fix this problem. Basically, you do not want to use the SplineOut data set. Instead, you want to construct a data set that has a range of WITH6 values and uses a specified constant for the other covariates. Generally, the mean is used for the continuous variables, such as Age, and reference levels are used for the classification variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For many models, you can use the EFFECTPLOT statement in the procedure or in PROC PLM for this. However, it might be that spline effects are not supported in the EFFECTPLOT statement. In that case, you can construct the scoring data yourself, as shown in the article, &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>Thu, 07 Oct 2021 10:04:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/visualization-of-proc-logistic-using-restricted-cubic-spline/m-p/772662#M37767</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2021-10-07T10:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: visualization of proc logistic using restricted cubic spline</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/visualization-of-proc-logistic-using-restricted-cubic-spline/m-p/772751#M37770</link>
      <description>&lt;P&gt;To plot the probability of the event against your WITH6 variable, just add an EFFECPLOT statement in your PROC LOGISTIC step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;effectplot fit(x=with6);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Oct 2021 14:18:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/visualization-of-proc-logistic-using-restricted-cubic-spline/m-p/772751#M37770</guid>
      <dc:creator>StatDave</dc:creator>
      <dc:date>2021-10-07T14:18:32Z</dc:date>
    </item>
  </channel>
</rss>

