<?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 Error calculating kappa with MKAPPA in Statistical Procedures</title>
    <link>https://communities.sas.com/t5/Statistical-Procedures/Error-calculating-kappa-with-MKAPPA/m-p/209359#M11342</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When running Bin Chen's MKAPPA macro, I get an error, but I am not sure why.&amp;nbsp; Specifically I am wondering whether I am not using the macro correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data set is attached.&amp;nbsp; There are 13 raters who rated 320 subjects on a 4-point ordinal scale.&amp;nbsp; (This is after I removed subjects with only one rater.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%include "\path\to\mkappa.sas"; /* from &lt;A href="http://www2.sas.com/proceedings/sugi30/155-30.pdf" title="http://www2.sas.com/proceedings/sugi30/155-30.pdf"&gt;http://www2.sas.com/proceedings/sugi30/155-30.pdf&lt;/A&gt; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let dloc = c:\temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let dset = rating_smile_transposed ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let Nrater = 13;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let Ncat = 4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let outfile = output.rtf ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%mkappa;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; data kap.koutput;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; set final;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; keep Kappa SE pvalue;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; Kappa=num/den;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; SE=sqrt(2*(den*den-pqpsum))/(den*sqrt( 320*13*(13-1)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; pvalue=1-probnorm(kappa/se);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;NOTE: Invalid argument to function SQRT(-0.290557332) at line 34 column 174.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;rate=4 x=188 xmx2=1914 p=0.0451923077 pq=0.043149963 pqp=0.0392498702 kj=0.111439652 numj=0.0048086169 num=0.0165537167 den=0.2357844859 &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;pqpsum=0.20087299 Kappa=0.0702069801 SE=. pvalue=. _ERROR_=1 _N_=1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Jul 2015 20:28:00 GMT</pubDate>
    <dc:creator>AndrewZ</dc:creator>
    <dc:date>2015-07-22T20:28:00Z</dc:date>
    <item>
      <title>Error calculating kappa with MKAPPA</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-calculating-kappa-with-MKAPPA/m-p/209359#M11342</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When running Bin Chen's MKAPPA macro, I get an error, but I am not sure why.&amp;nbsp; Specifically I am wondering whether I am not using the macro correctly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My data set is attached.&amp;nbsp; There are 13 raters who rated 320 subjects on a 4-point ordinal scale.&amp;nbsp; (This is after I removed subjects with only one rater.)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My code&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%include "\path\to\mkappa.sas"; /* from &lt;A href="http://www2.sas.com/proceedings/sugi30/155-30.pdf" title="http://www2.sas.com/proceedings/sugi30/155-30.pdf"&gt;http://www2.sas.com/proceedings/sugi30/155-30.pdf&lt;/A&gt; */&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let dloc = c:\temp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let dset = rating_smile_transposed ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let Nrater = 13;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let Ncat = 4;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%let outfile = output.rtf ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;%mkappa;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The error&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; data kap.koutput;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; set final;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; keep Kappa SE pvalue;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; Kappa=num/den;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; SE=sqrt(2*(den*den-pqpsum))/(den*sqrt( 320*13*(13-1)));&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; pvalue=1-probnorm(kappa/se);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;MPRINT(MKAPPA):&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;NOTE: Invalid argument to function SQRT(-0.290557332) at line 34 column 174.&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;rate=4 x=188 xmx2=1914 p=0.0451923077 pq=0.043149963 pqp=0.0392498702 kj=0.111439652 numj=0.0048086169 num=0.0165537167 den=0.2357844859 &lt;/SPAN&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;pqpsum=0.20087299 Kappa=0.0702069801 SE=. pvalue=. _ERROR_=1 _N_=1&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 20:28:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-calculating-kappa-with-MKAPPA/m-p/209359#M11342</guid>
      <dc:creator>AndrewZ</dc:creator>
      <dc:date>2015-07-22T20:28:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error calculating calla with MKAPPA</title>
      <link>https://communities.sas.com/t5/Statistical-Procedures/Error-calculating-kappa-with-MKAPPA/m-p/209360#M11343</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Proximate cause:&lt;/P&gt;&lt;P&gt;den=0.2357844859 &lt;SPAN style="font-family: courier new,courier;"&gt;pqpsum=0.20087299&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;sqrt (2* (den*den - pqpsum))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;the den*den is calculated first with value in the .055 range. Subtract 0.200 and the result is negative.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;It may be that some of your values are pushing the boundaries of what the macro was designed for but pqpsum has to be less than den*den to avoid this error.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Jul 2015 20:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Statistical-Procedures/Error-calculating-kappa-with-MKAPPA/m-p/209360#M11343</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-07-22T20:34:09Z</dc:date>
    </item>
  </channel>
</rss>

