<?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: Classification of predicted value on logistic regression model in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Classification-of-predicted-value-on-logistic-regression-model/m-p/560614#M74875</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    by patient_id;
    prev_pred=lag(prediction);
    if first.patient_id then do; 
        non_cumulative_prediction=prediction;
        output;
    end;
    else if not last.patient_id then do;
        non_cumulative_prediction=prediction-prev_pred;
        output;
    end;
    else if last.patient_id then do;
        non_cumulative_prediction=prediction-prev_pred;
        output;
        level=4;
        non_cumulative_prediction=1-prev_pred;
        output;
    end;
    drop prev_pred;
run;
proc summary nway data=want;
    class patient_id;
    var non_cumulative_prediction;
    output out=maximum max=max_prediction 
        maxid(non_cumulative_prediction(level))=level_at_max_pred;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 21 May 2019 18:37:44 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-05-21T18:37:44Z</dc:date>
    <item>
      <title>Classification of predicted value on logistic regression model</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Classification-of-predicted-value-on-logistic-regression-model/m-p/560611#M74874</link>
      <description>&lt;P&gt;Dear Communities:&lt;/P&gt;&lt;P&gt;Greetings all!&lt;/P&gt;&lt;P&gt;I have data in the following format.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Patient_ID&amp;nbsp; status&amp;nbsp; level&amp;nbsp; prediction&lt;/P&gt;&lt;P&gt;165201&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0090204072&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;165201&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.4682205524&lt;/P&gt;&lt;P&gt;165201&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.8122016298&lt;/P&gt;&lt;P&gt;165201&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.9751736188&lt;/P&gt;&lt;P&gt;165205&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0081253999&lt;/P&gt;&lt;P&gt;165205&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.4420893893&amp;nbsp;&lt;/P&gt;&lt;P&gt;165205&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.7955942710&lt;/P&gt;&lt;P&gt;165205&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.9724900318&lt;/P&gt;&lt;P&gt;165208&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.0011220970&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .&lt;/P&gt;&lt;P&gt;165210&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.0980113921&lt;/P&gt;&lt;P&gt;165210&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.3479984169&lt;/P&gt;&lt;P&gt;165210&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;0.8289891254&lt;/P&gt;&lt;P&gt;165210&amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 3&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.9509891254&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...etc&lt;/P&gt;&lt;P&gt;Here I have two questions:&lt;/P&gt;&lt;P&gt;1. The "prediction" variable is the predicted cumulative probability for ordinal response 0 to 4(but 4 is reference due to the fact that it is not displayed in the table). But I want create a variable that change the cumulative probability into non-cumulative probability, that is, example for the first patient_Id with the 0 level: cumulative probability at level 1 minus at level 0,&amp;nbsp; for&amp;nbsp;the first patient_Id with the second level:&amp;nbsp;cumulative probability at level 2 minus at level 1,&amp;nbsp;&amp;nbsp;for&amp;nbsp;the first patient_Id with the third level:&amp;nbsp;cumulative probability at level 3 minus at level 2, and finally one minus&amp;nbsp;cumulative probability at level 3. The same procedure for all Patient Id.&lt;/P&gt;&lt;P&gt;Finally&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. Based on the created variable in "1" I want to select a level with maximum probability so that I can get one probability value per patient_Id.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;I'm happy to justify it if it is not clear.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 May 2019 18:28:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Classification-of-predicted-value-on-logistic-regression-model/m-p/560611#M74874</guid>
      <dc:creator>Lijuu</dc:creator>
      <dc:date>2019-05-21T18:28:08Z</dc:date>
    </item>
    <item>
      <title>Re: Classification of predicted value on logistic regression model</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Classification-of-predicted-value-on-logistic-regression-model/m-p/560614#M74875</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
    set have;
    by patient_id;
    prev_pred=lag(prediction);
    if first.patient_id then do; 
        non_cumulative_prediction=prediction;
        output;
    end;
    else if not last.patient_id then do;
        non_cumulative_prediction=prediction-prev_pred;
        output;
    end;
    else if last.patient_id then do;
        non_cumulative_prediction=prediction-prev_pred;
        output;
        level=4;
        non_cumulative_prediction=1-prev_pred;
        output;
    end;
    drop prev_pred;
run;
proc summary nway data=want;
    class patient_id;
    var non_cumulative_prediction;
    output out=maximum max=max_prediction 
        maxid(non_cumulative_prediction(level))=level_at_max_pred;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 21 May 2019 18:37:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Classification-of-predicted-value-on-logistic-regression-model/m-p/560614#M74875</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-05-21T18:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Classification of predicted value on logistic regression model</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Classification-of-predicted-value-on-logistic-regression-model/m-p/561041#M74883</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;SPAN class="login-bold"&gt;&lt;A href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892" target="_self"&gt;PaigeMiller&lt;/A&gt;:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class="login-bold"&gt;Appreciated!!! Thank you very much in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 05:30:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Classification-of-predicted-value-on-logistic-regression-model/m-p/561041#M74883</guid>
      <dc:creator>Lijuu</dc:creator>
      <dc:date>2019-05-23T05:30:08Z</dc:date>
    </item>
  </channel>
</rss>

