<?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 Automate creation of ROC curves from contingency tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Automate-creation-of-ROC-curves-from-contingency-tables/m-p/185681#M35231</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro that successfully creates 2x2 contingency tables, one for each value of a variable X.&amp;nbsp; The contingency tables are created from PROC FREQ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I would like to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) calculate the specificity and sensitivity from each table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) plot all pairs of sensitivity and 1-specificity to create an ROC curve (sensitivity vs. 1-specificity) for all values of X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to automate this in SAS?&amp;nbsp; I can't find a way to do so via searching on Google or SAS documentation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I envision the successful macro being able to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) extract the counts from each cell in each contingency table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) calculate sensitivity and 1-specificity for each contingency table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) plot sensitivity vs. 1-specificity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I can't figure out how to do this.&amp;nbsp; (I'm sure that DO-loops and arrays are needed somehow.) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, right now, I am typing the counts by hand into Microsoft Excel and plotting the ROC curve there.&amp;nbsp; This worked initially when I only had to create 5 ROC curves, but I now need to produce 20, and I wish to automate this process.&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;&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;&lt;/P&gt;&lt;P&gt;Any help that you can provide would be much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jan 2014 01:13:46 GMT</pubDate>
    <dc:creator>EricCai</dc:creator>
    <dc:date>2014-01-02T01:13:46Z</dc:date>
    <item>
      <title>Automate creation of ROC curves from contingency tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-creation-of-ROC-curves-from-contingency-tables/m-p/185681#M35231</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a macro that successfully creates 2x2 contingency tables, one for each value of a variable X.&amp;nbsp; The contingency tables are created from PROC FREQ.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I would like to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1) calculate the specificity and sensitivity from each table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2) plot all pairs of sensitivity and 1-specificity to create an ROC curve (sensitivity vs. 1-specificity) for all values of X&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to automate this in SAS?&amp;nbsp; I can't find a way to do so via searching on Google or SAS documentation. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I envision the successful macro being able to&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a) extract the counts from each cell in each contingency table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;b) calculate sensitivity and 1-specificity for each contingency table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;c) plot sensitivity vs. 1-specificity&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I can't figure out how to do this.&amp;nbsp; (I'm sure that DO-loops and arrays are needed somehow.) &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thus, right now, I am typing the counts by hand into Microsoft Excel and plotting the ROC curve there.&amp;nbsp; This worked initially when I only had to create 5 ROC curves, but I now need to produce 20, and I wish to automate this process.&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;&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;&lt;/P&gt;&lt;P&gt;Any help that you can provide would be much appreciated!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Eric&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 01:13:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-creation-of-ROC-curves-from-contingency-tables/m-p/185681#M35231</guid>
      <dc:creator>EricCai</dc:creator>
      <dc:date>2014-01-02T01:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Automate creation of ROC curves from contingency tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Automate-creation-of-ROC-curves-from-contingency-tables/m-p/185682#M35232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi:&lt;/P&gt;&lt;P&gt;&amp;nbsp; You might post this in the SAS/Graph and ODS Graphics forum. This paper/presentation, for example, shows a method using the SG procedures from data that seems to be generated with PROC FREQ&lt;/P&gt;&lt;P&gt;(&lt;A href="http://www.phuse.eu/download.aspx?type=cms&amp;amp;docID=4192" title="http://www.phuse.eu/download.aspx?type=cms&amp;amp;docID=4192"&gt;http://www.phuse.eu/download.aspx?type=cms&amp;amp;docID=4192&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jan 2014 03:04:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Automate-creation-of-ROC-curves-from-contingency-tables/m-p/185682#M35232</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-01-02T03:04:08Z</dc:date>
    </item>
  </channel>
</rss>

