<?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 Calculate sensitivity and specificity without generating 2 by 2 table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275097#M54968</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am trying to calculate sensitivity and specificity of a test (e.g. test2) with reference to a standard test (e.g. test1). I am interested to know&amp;nbsp;a way where I can calculate sensitivity and specificity without multiple proc freq steps. &amp;nbsp;A sample of my data is gievn below:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sensitivity_study;
input test1 test2;
datalines;
1 1 
1 0 
0 1 
0 0
1 1 
1 0 
0 0 
0 0
0 0 
0 0 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you in advance for your kind reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;With Regards,&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;</description>
    <pubDate>Fri, 03 Jun 2016 19:32:31 GMT</pubDate>
    <dc:creator>DeepakSwain</dc:creator>
    <dc:date>2016-06-03T19:32:31Z</dc:date>
    <item>
      <title>Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275097#M54968</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;I am trying to calculate sensitivity and specificity of a test (e.g. test2) with reference to a standard test (e.g. test1). I am interested to know&amp;nbsp;a way where I can calculate sensitivity and specificity without multiple proc freq steps. &amp;nbsp;A sample of my data is gievn below:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sensitivity_study;
input test1 test2;
datalines;
1 1 
1 0 
0 1 
0 0
1 1 
1 0 
0 0 
0 0
0 0 
0 0 
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Thank you in advance for your kind reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;With Regards,&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 19:32:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275097#M54968</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2016-06-03T19:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275113#M54972</link>
      <description>&lt;P&gt;This is the same as this question, essentially.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Procedures/Getting-PROC-FREQ-Report-Output-With-Another-Format-and-Doing/m-p/274990" target="_blank"&gt;https://communities.sas.com/t5/SAS-Procedures/Getting-PROC-FREQ-Report-Output-With-Another-Format-and-Doing/m-p/274990&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jun 2016 20:34:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275113#M54972</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-03T20:34:57Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275151#M54989</link>
      <description>&lt;PRE&gt;
This could give you a start .



data sensitivity_study;
input test1 test2;
datalines;
1 1 
1 0 
0 1 
0 0
1 1 
1 0 
0 0 
0 0
0 0 
0 0 
;
run;
proc sql;
 select test1,sum(test1=test2)/count(*) as sensitivity,
   case when test1=0 then 'specificity' else 'sensitivity'  end as name
  from sensitivity_study
   group by test1;
quit;

&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Jun 2016 03:52:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275151#M54989</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-04T03:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275400#M55065</link>
      <description>&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Great solution as I have been looking for without generating 2 by 2 table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;With Kind regards,&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 13:57:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275400#M55065</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2016-06-06T13:57:06Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275401#M55066</link>
      <description>&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;Is it possible to extend this code to calculate PPV and NPV.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for your kind reply.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 13:59:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275401#M55066</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2016-06-06T13:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275545#M55101</link>
      <description>&lt;P&gt;Technically , it could be . Give us formula about them .&lt;/P&gt;
&lt;P&gt;Or you could change&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;sum(test1=test2)/count(*)&lt;/PRE&gt;
&lt;P&gt;into&lt;/P&gt;
&lt;PRE&gt;sum(test1 ne test2)/count(*)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;and see whether it is what you want.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 01:39:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/275545#M55101</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-07T01:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/276100#M55295</link>
      <description>&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;I tried the following sas code but could not generate the desired result.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data sensitivity_study;
input test1 test2;
datalines;
1 1 
1 0 
0 1 
0 0
1 1 
1 0 
0 0 
0 0
0 0 
0 0 
;
run;

proc sql;
 select test1,sum(test1 ne test2)/count(*) as ppv,
   case when test1=0 then 'NPV' else 'PPV'  end as name
  from sensitivity_study
   group by test1;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Can you kindly help me further.&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Positive Predictive Value =True Positive/(True Positive + False Positive)&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;Negative Predictive Value=True Negative/(True Negative + False Negative)&lt;/P&gt;&lt;P&gt;Thank you in advance for your kind reply.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 08 Jun 2016 20:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/276100#M55295</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2016-06-08T20:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/276115#M55299</link>
      <description>&lt;P&gt;The logic is to write a sum statement with the conditions inside the sum statement that meet your requirements, ie true positive is test1=1 and test2=1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The first link I posted demonstrates this a bit. You should be able to extend the logic already provided to your new scenario. Please try and post what you've tried and isn't working if you need further help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jun 2016 21:15:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/276115#M55299</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-06-08T21:15:01Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/276142#M55310</link>
      <description>&lt;PRE&gt;
OK. Just change GROUP variable into TEST2.



data sensitivity_study;
input test1 test2;
datalines;
1 1 
1 0 
0 1 
0 0
1 1 
1 0 
0 0 
0 0
0 0 
0 0 
;
run;

proc sql;
 select test2,sum(test1=test2)/count(*) as ppv,
   case when test2=0 then 'NPV' else 'PPV'  end as name
  from sensitivity_study
   group by test2;
quit;

&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Jun 2016 03:00:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/276142#M55310</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-06-09T03:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculate sensitivity and specificity without generating 2 by 2 table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/276608#M55436</link>
      <description>&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;Kindly accept my apology for the delayed reply. Your tips has worked nicely and has provided me a very simple way to calulate Sensitivity, Specificity, PPV, NPV without creating 2 by 2 table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot for your honest effort to help me.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Appreciated.&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Deepak&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jun 2016 20:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calculate-sensitivity-and-specificity-without-generating-2-by-2/m-p/276608#M55436</guid>
      <dc:creator>DeepakSwain</dc:creator>
      <dc:date>2016-06-10T20:20:02Z</dc:date>
    </item>
  </channel>
</rss>

