<?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: plotting multiple logistic regression in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910790#M45200</link>
    <description>&lt;P&gt;Sure .Just use PROC PLM to get those data instead of PLOTS= option due to PROC GLM/REG don't have such graph as PROC LOGISTIC( I didn't found it ,maybe someone could).&lt;/P&gt;
&lt;P&gt;Also could check Rick.Wicklin 's blogs:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/02/11/proc-plm-regression-models-sas.html" target="_blank"&gt;4 reasons to use PROC PLM for linear regression models in SAS - The DO Loop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html" target="_blank"&gt;Use the EFFECTPLOT statement to visualize regression models in SAS - The DO Loop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2020/01/08/confidence-band-regression-sas.html" target="_blank"&gt;3 ways to add confidence limits to regression curves in SAS - The DO Loop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2020/10/12/visualize-uncertainty-regression-predictions.html" target="_blank"&gt;Visualize uncertainty in regression predictions - The DO Loop (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
 set sashelp.heart(obs=200);
run;






ods select none;
proc glm data=have ;
model ageatstart = Diastolic  Systolic /  solution ;
store PainModel;
quit;
proc plm restore=PainModel;
   effectplot fit(x=Diastolic )/clm;
   effectplot fit(x=Systolic )/clm;
   ods output  FitPlot= FitPlot;
run;
ods select all;
data FitPlot;
 set FitPlot;
 id+1;
run;
proc rank data=FitPlot out=want groups=2; /*2 is refer to two X variables(Diastolic  Systolic)*/
 var id;
 ranks group;  
run;
proc format;
value fmt
0='Diastolic'
1='Systolic'
;
run;
ods graphics/attrpriority=none ;
proc sgplot data=want ;
styleattrs datalinepatterns=(solid dash);
band x=_XCONT1 lower=_LCLM upper=_UCLM/group=group transparency=0.8;
series x=_XCONT1 y=_PREDICTED /group=group name='x';
keylegend 'x';
label _XCONT1='Diastolic and Systolic' _PREDICTED='ageatstart' ;
format group fmt.;
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-1704680497536.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92369iCDCF7E64E47069A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1704680497536.png" alt="Ksharp_0-1704680497536.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jan 2024 02:23:04 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2024-01-08T02:23:04Z</dc:date>
    <item>
      <title>plotting multiple logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910754#M45196</link>
      <description>&lt;P&gt;Dears,&lt;/P&gt;&lt;P&gt;I would like to overlay two plots that are outputted by the plots= command in PROC LOGISTIC.&lt;/P&gt;&lt;P&gt;This is the syntax that I use:&lt;/P&gt;&lt;P&gt;proc logistic data=mergedss plots=effect ( clband=yes SHOWOBS=no x=(E_emo I_emo )) ;&lt;BR /&gt;model genre(event= 'literary') = E_emo I_emo /stb cl ;&lt;/P&gt;&lt;P&gt;The result is shown below.&lt;/P&gt;&lt;P&gt;Is there a way to overlay the two slopes, using different colors and symbols (e.g. continuous vs dotted line)?&amp;nbsp;&lt;/P&gt;&lt;P&gt;The two predictors are both standardized, and the range is +4.5 and -3. Thus the x-axis range could be put at -6 / +6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Screenshot 2024-01-07 at 10.06.52.png" style="width: 694px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92351i3793F6BED9D02401/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screenshot 2024-01-07 at 10.06.52.png" alt="Screenshot 2024-01-07 at 10.06.52.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2024 09:11:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910754#M45196</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2024-01-07T09:11:28Z</dc:date>
    </item>
    <item>
      <title>Re: plotting multiple logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910756#M45197</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*
1)get these data.
2)overlay these two graph by PROC SGPLOT.
*/
data have;
 set sashelp.heart(obs=200);
run;






ods select none;
ods output  EffectPlot= EffectPlot;
proc logistic data=have plots=effect ( clband=yes SHOWOBS=no x=(Diastolic  Systolic)) ;
model status = Diastolic  Systolic /stb cl ;
run;
ods select all;
data EffectPlot;
 set EffectPlot;
 id+1;
run;
proc rank data=EffectPlot out=want groups=2; /*2 is refer to two X variables(Diastolic  Systolic)*/
 var id;
 ranks group;  
run;
proc format;
value fmt
0='Diastolic'
1='Systolic'
;
run;
ods graphics/attrpriority=none ;
proc sgplot data=want ;
styleattrs datalinepatterns=(solid dash);
band x=_XVAR lower=_lower upper=_upper/group=group transparency=0.8;
series x=_XVAR y=_PROB /group=group name='x';
keylegend 'x';
yaxis values=(0 to 1 by 0.1);
label _XVAR='E_mmo and L_mmo' _PROB='Proability' ;
format group fmt.;
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-1704622051469.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92352i4A14463A33F6FDA2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1704622051469.png" alt="Ksharp_0-1704622051469.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2024 10:08:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910756#M45197</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-01-07T10:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: plotting multiple logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910757#M45198</link>
      <description>&lt;P&gt;Thank you! it works seamlessly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2024 10:39:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910757#M45198</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2024-01-07T10:39:42Z</dc:date>
    </item>
    <item>
      <title>Re: plotting multiple logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910758#M45199</link>
      <description>&lt;P&gt;I will push my luck...&lt;/P&gt;&lt;P&gt;any chance you could suggest the same for a multiple linear regression?&lt;/P&gt;&lt;P&gt;proc reg data=xx&amp;nbsp; ;&lt;BR /&gt;model DV1 = IV1 IV2 ;&lt;/P&gt;</description>
      <pubDate>Sun, 07 Jan 2024 11:19:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910758#M45199</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2024-01-07T11:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: plotting multiple logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910790#M45200</link>
      <description>&lt;P&gt;Sure .Just use PROC PLM to get those data instead of PLOTS= option due to PROC GLM/REG don't have such graph as PROC LOGISTIC( I didn't found it ,maybe someone could).&lt;/P&gt;
&lt;P&gt;Also could check Rick.Wicklin 's blogs:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2019/02/11/proc-plm-regression-models-sas.html" target="_blank"&gt;4 reasons to use PROC PLM for linear regression models in SAS - The DO Loop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2016/06/22/sas-effectplot-statement.html" target="_blank"&gt;Use the EFFECTPLOT statement to visualize regression models in SAS - The DO Loop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2020/01/08/confidence-band-regression-sas.html" target="_blank"&gt;3 ways to add confidence limits to regression curves in SAS - The DO Loop&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/iml/2020/10/12/visualize-uncertainty-regression-predictions.html" target="_blank"&gt;Visualize uncertainty in regression predictions - The DO Loop (sas.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;
data have;
 set sashelp.heart(obs=200);
run;






ods select none;
proc glm data=have ;
model ageatstart = Diastolic  Systolic /  solution ;
store PainModel;
quit;
proc plm restore=PainModel;
   effectplot fit(x=Diastolic )/clm;
   effectplot fit(x=Systolic )/clm;
   ods output  FitPlot= FitPlot;
run;
ods select all;
data FitPlot;
 set FitPlot;
 id+1;
run;
proc rank data=FitPlot out=want groups=2; /*2 is refer to two X variables(Diastolic  Systolic)*/
 var id;
 ranks group;  
run;
proc format;
value fmt
0='Diastolic'
1='Systolic'
;
run;
ods graphics/attrpriority=none ;
proc sgplot data=want ;
styleattrs datalinepatterns=(solid dash);
band x=_XCONT1 lower=_LCLM upper=_UCLM/group=group transparency=0.8;
series x=_XCONT1 y=_PREDICTED /group=group name='x';
keylegend 'x';
label _XCONT1='Diastolic and Systolic' _PREDICTED='ageatstart' ;
format group fmt.;
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-1704680497536.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/92369iCDCF7E64E47069A6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1704680497536.png" alt="Ksharp_0-1704680497536.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 02:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910790#M45200</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-01-08T02:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: plotting multiple logistic regression</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910799#M45201</link>
      <description>&lt;P&gt;hello. Yes,&amp;nbsp;&lt;SPAN&gt;Rick.Wicklin's blog and responses here have been immensely valuable to me. I have seen these entries on his blog, but they refer to situations where there is one continuous predictor and a categorical one, and show how you can get separate slops for each of the level of the categorical variable, in the same graph.&amp;nbsp; But I could not find a way to put the slopes of&amp;nbsp; two continuous predictors in the same graph. Your solution for when I had PROC LOGISTIC as the starting point worked perfectly, but I could not find a way to adapt it to the situation in which my starting point PROC REG (or PROC GLM), in which my criterion is continuous, rather than categorical.&amp;nbsp; When you have two continuous predictors, PROC GLM gives you a contour plot with the Plot=fit option, but that is not what I want. A solution where I can use SGPLOT with the output of the PROC REG or PROC GLM would be best, since SGPLOT allows to adjust the graph features.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you again. &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2024 07:25:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/plotting-multiple-logistic-regression/m-p/910799#M45201</guid>
      <dc:creator>emaneman</dc:creator>
      <dc:date>2024-01-08T07:25:52Z</dc:date>
    </item>
  </channel>
</rss>

