<?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: multinominal logistic regression prediction in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521829#M26502</link>
    <description>&lt;P&gt;Just look at the documentation, which has all the details in the "Details" Chapter. You might start with these&amp;nbsp;two sections:&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_logistic_overview.htm&amp;amp;locale=en" target="_self"&gt;The generalized logit model&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_logistic_details03.htm&amp;amp;locale=en" target="_self"&gt;Link functions&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wikipedia also has a nice &lt;A href="https://en.wikipedia.org/wiki/Multinomial_logistic_regression" target="_self"&gt;overview article on multinomial logistic regression.&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 16 Dec 2018 23:58:09 GMT</pubDate>
    <dc:creator>Rick_SAS</dc:creator>
    <dc:date>2018-12-16T23:58:09Z</dc:date>
    <item>
      <title>multinominal logistic regression prediction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521390#M26489</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to use proc logit to predict a multinomial variable (polyshaptria) with 3 levels (1,2,3). The code is as follow:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=triathlon_pct;
class polyshaptria;
model polyshaptria =pctPoly_bysurg age sex/ link=glogit;  
output out=pred predicted=pred;   
run;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As&amp;nbsp;polyshaptria has 3 level, I assume the predicted probability will distributed consistently with each level (sas will give three predicted probability for each &lt;SPAN&gt;polyshaptria level&lt;/SPAN&gt;). That is if the &lt;SPAN&gt;polyshaptria&lt;/SPAN&gt; is 1, SAS gives three probability for it corresponding to level 1,2,3. However, the predicted probability of level 1 is always larger than the other two levels. It doesn't make sense. See the data below:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;polyshaptria&lt;/TD&gt;&lt;TD&gt;_LEVEL_&lt;/TD&gt;&lt;TD&gt;pred_prob&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0.40541&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0.37396&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0.22063&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0.39646&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0.36705&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0.23648&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;0.45166&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;0.44938&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;0.09896&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For&amp;nbsp;&lt;SPAN&gt;polyshaptria=2,&amp;nbsp;pred_prob should get the largest when _level_=2. But it's still largest when _level_=1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone explain the reasons? How SAS predicted multinomial logistic model?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Andrea&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Dec 2018 07:30:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521390#M26489</guid>
      <dc:creator>Andrea_Peng</dc:creator>
      <dc:date>2018-12-14T07:30:36Z</dc:date>
    </item>
    <item>
      <title>Re: multinominal logistic regression prediction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521459#M26491</link>
      <description>&lt;P&gt;&amp;gt;&amp;nbsp;&lt;SPAN&gt;For&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;polyshaptria=2,&amp;nbsp;pred_prob should get the largest when _level_=2. But it's still largest when _level_=1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;No, that is not correct. Just because the observed value is 2 does not mean that the predicted value will be 2. The predicted value is based on the values of the explanatory variables. Some observations will be inevitably be misclassified&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I suggest you change from the PREDICTED= option to the PREDPROBS=(INDIVIDUAL_ option. That will create an output data set that is the same size&amp;nbsp;as the input data. The variables _FROM_ and _INTO_ in the output data set show&amp;nbsp;the observed and predicted categories for each&amp;nbsp;observation, You can use PROC FREQ to display a misclassification table, as follows:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc logistic data=sashelp.cars;
class origin;
model origin = mpg_city weight / link=glogit;  
output out=pred predprobs=(individual);   
run;
quit;

proc freq data=pred;
tables _FROM_*_INTO_;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 14 Dec 2018 13:52:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521459#M26491</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-12-14T13:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: multinominal logistic regression prediction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521826#M26501</link>
      <description>&lt;P&gt;Hi Rick,&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;I did have a look at the misclassification. The proportion is huge (around 50%). That's the reason I want to know how proc logistic works when predicting using glogit.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 23:01:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521826#M26501</guid>
      <dc:creator>Andrea_Peng</dc:creator>
      <dc:date>2018-12-16T23:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: multinominal logistic regression prediction</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521829#M26502</link>
      <description>&lt;P&gt;Just look at the documentation, which has all the details in the "Details" Chapter. You might start with these&amp;nbsp;two sections:&lt;BR /&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_logistic_overview.htm&amp;amp;locale=en" target="_self"&gt;The generalized logit model&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://go.documentation.sas.com/?docsetId=statug&amp;amp;docsetVersion=14.3&amp;amp;docsetTarget=statug_logistic_details03.htm&amp;amp;locale=en" target="_self"&gt;Link functions&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Wikipedia also has a nice &lt;A href="https://en.wikipedia.org/wiki/Multinomial_logistic_regression" target="_self"&gt;overview article on multinomial logistic regression.&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 16 Dec 2018 23:58:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/multinominal-logistic-regression-prediction/m-p/521829#M26502</guid>
      <dc:creator>Rick_SAS</dc:creator>
      <dc:date>2018-12-16T23:58:09Z</dc:date>
    </item>
  </channel>
</rss>

