<?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: Scatterplot of logistic regression model-predicted log odds of the outcome by a continuous predi in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799699#M314465</link>
    <description>&lt;P&gt;Something like these?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples02.htm#statug.logistic.logx2rf" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples02.htm#statug.logistic.logx2rf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, look into the EFFECTPLOT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/401848"&gt;@greesamu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to check that I meet the linearity assumption for logist regression.&lt;/P&gt;
&lt;P&gt;I want to plot the model-predicted log odds of the outcome by a continuous predictor in a scatter plot. Is there a way to do this in SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure it's needed but the code for my logistic model is below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc logistic data=ST;&lt;BR /&gt;class dow moonphase;&lt;BR /&gt;model complication(event='1') = hour month_concern dow moonphase ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 02 Mar 2022 21:55:28 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2022-03-02T21:55:28Z</dc:date>
    <item>
      <title>Scatterplot of logistic regression model-predicted log odds of the outcome by a continuous predictor</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799696#M314464</link>
      <description>&lt;P&gt;I'm trying to check that I meet the linearity assumption for logist regression.&lt;/P&gt;&lt;P&gt;I want to plot the model-predicted log odds of the outcome by a continuous predictor in a scatter plot. Is there a way to do this in SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure it's needed but the code for my logistic model is below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc logistic data=ST;&lt;BR /&gt;class dow moonphase;&lt;BR /&gt;model complication(event='1') = hour month_concern dow moonphase ;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 21:47:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799696#M314464</guid>
      <dc:creator>greesamu</dc:creator>
      <dc:date>2022-03-02T21:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot of logistic regression model-predicted log odds of the outcome by a continuous predi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799699#M314465</link>
      <description>&lt;P&gt;Something like these?&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples02.htm#statug.logistic.logx2rf" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.4/statug/statug_logistic_examples02.htm#statug.logistic.logx2rf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, look into the EFFECTPLOT statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/401848"&gt;@greesamu&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I'm trying to check that I meet the linearity assumption for logist regression.&lt;/P&gt;
&lt;P&gt;I want to plot the model-predicted log odds of the outcome by a continuous predictor in a scatter plot. Is there a way to do this in SAS?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure it's needed but the code for my logistic model is below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc logistic data=ST;&lt;BR /&gt;class dow moonphase;&lt;BR /&gt;model complication(event='1') = hour month_concern dow moonphase ;&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 21:55:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799699#M314465</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-03-02T21:55:28Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot of logistic regression model-predicted log odds of the outcome by a continuous predi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799707#M314466</link>
      <description>&lt;P&gt;Thanks, this is on the right track and I'll keep looking in this direction. That said, I'd like the Y-axis to be the predicted log odds instead of predicted probability and I'd like the plot to be a scatterplot.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Mar 2022 23:13:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799707#M314466</guid>
      <dc:creator>greesamu</dc:creator>
      <dc:date>2022-03-02T23:13:50Z</dc:date>
    </item>
    <item>
      <title>Re: Scatterplot of logistic regression model-predicted log odds of the outcome by a continuous predi</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799711#M314469</link>
      <description>&lt;P&gt;Sorry, what's the difference with predicted log odds versus predicted probability? Is this to check the linearity of the terms with respect to the regression?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since I suspect it's just conversions of the values, you may want to use the EFFECTPLOT and capture the data behind the graph. Then plot it yourself using SGPLOT.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's some instructions and explanations on how to capture output that is shown. &lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods-output-statement/" target="_blank"&gt;https://blogs.sas.com/content/sastraining/2017/03/31/capturing-output-from-any-procedure-with-an-ods-output-statement/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For shown example, depending on your effectplot statement your ods table name may vary.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods select none;
ods output   SliceFitPanel=rawData;
proc logistic data=Neuralgia plots(only)=(oddsratio(range=clip));
   class Treatment Sex /param=ref;
   model Pain= Treatment Sex Age / noor;
   effectplot / at(Sex=all) noobs;
run;
ods select all;

proc print data=rawData;
run;

data scaled;
set rawDAta;
logsvalue = log(_predicted/(1-_predicted));
run;

proc sgplot data=scaled;
where _at = "Sex=F";
scatter x=_xcont1 y=logsValue / jitter;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;There are too many data points in this one so the points blend together to form a line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You could reduce the frequency and take every 5th or 10th value I suppose.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 03 Mar 2022 00:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Scatterplot-of-logistic-regression-model-predicted-log-odds-of/m-p/799711#M314469</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-03-03T00:06:23Z</dc:date>
    </item>
  </channel>
</rss>

