<?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: Kappa and percent agreement for multiple variables in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/250496#M56591</link>
    <description>&lt;P&gt;You didn't post sample data yet .&lt;/P&gt;
&lt;P&gt;And remember KAPPA is only for square contingecy table .&lt;/P&gt;
&lt;P&gt;It looks like you need some data step code not proc freq?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Feb 2016 03:45:45 GMT</pubDate>
    <dc:creator>Ksharp</dc:creator>
    <dc:date>2016-02-17T03:45:45Z</dc:date>
    <item>
      <title>Kappa and percent agreement for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/250491#M56590</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I wanted to know how can I run kappa and percent agreement on multiple variables and get the output all in one.&lt;/P&gt;&lt;P&gt;eg. my data looks like this (rater A&amp;nbsp;and &amp;nbsp;rater B) and there are 3 different vars ( I have &amp;gt; 20 variables in the actual dataset) :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id &amp;nbsp; var1_A &amp;nbsp; var2_B &amp;nbsp;...&amp;nbsp;&amp;nbsp; &amp;nbsp;var2_A ... var2_B &amp;nbsp; ... &amp;nbsp; var3_A ...var3_B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want the output like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Kappa &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; percent agreement &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var1&lt;/P&gt;&lt;P&gt;var2&amp;nbsp;&lt;/P&gt;&lt;P&gt;var3&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 03:07:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/250491#M56590</guid>
      <dc:creator>AZIQ1</dc:creator>
      <dc:date>2016-02-17T03:07:56Z</dc:date>
    </item>
    <item>
      <title>Re: Kappa and percent agreement for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/250496#M56591</link>
      <description>&lt;P&gt;You didn't post sample data yet .&lt;/P&gt;
&lt;P&gt;And remember KAPPA is only for square contingecy table .&lt;/P&gt;
&lt;P&gt;It looks like you need some data step code not proc freq?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 03:45:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/250496#M56591</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-02-17T03:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Kappa and percent agreement for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/250502#M56592</link>
      <description>&lt;P&gt;Transpose your data to this structure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;id varName rating_A rating_B&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and use proc freq, by varName.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Feb 2016 04:18:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/250502#M56592</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-17T04:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: Kappa and percent agreement for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/251016#M56659</link>
      <description>&lt;P&gt;... For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Example data */
data test;
call streaminit(8687);
do id = 1 to 10;
    array v Var1_A Var1_B Var2_A Var2_B Var3_A Var3_B;
    do i = 1 to dim(v); 
        v{i} = rand("Poisson", 2);
        end;
    output;
    end;
drop i;
run;

proc print data=test noobs; run;

/* Transpose, assuming variables are named variableName_raterName */
data long;
set test;
array v Var1_A -- Var3_B;
do i = 1 to dim(v) by 2;
    var = scan(vname(v{i}), 1, "_");
    val_A = v{i};    
    val_B = v{i+1};
    output;
    end;
keep var val_A val_B;
run;

proc print data=long(obs=6) noobs; run;

/* Call freq to get Kappa between A and B, get kappa table with ODS */
proc sort data=long; by var; run;

proc freq data=long;
by var;
table val_A*val_B / noprint agree plots=none;
ods output KappaStatistics=kappa;
run;

proc print data=kappa noobs; run;

/* Print Kappa table */
proc sql;
select 
    var length=16,
    value "Kappa",
    max(0, value) "Percent agreement" format=percent7.1
from kappa
where statistic = "Simple Kappa";
quit;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 19 Feb 2016 04:24:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/251016#M56659</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2016-02-19T04:24:40Z</dc:date>
    </item>
    <item>
      <title>Re: Kappa and percent agreement for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/251356#M56690</link>
      <description>Thank you so much - stay blessed - you saved me so much time -&lt;BR /&gt;Best Regards</description>
      <pubDate>Sat, 20 Feb 2016 20:38:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/251356#M56690</guid>
      <dc:creator>AZIQ1</dc:creator>
      <dc:date>2016-02-20T20:38:56Z</dc:date>
    </item>
    <item>
      <title>Re: Kappa and percent agreement for multiple variables</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/259820#M57497</link>
      <description>&lt;P&gt;Thanks again,&lt;/P&gt;&lt;P&gt;Now I want to add third rater any insights how to change the array statement?&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;</description>
      <pubDate>Tue, 29 Mar 2016 17:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Kappa-and-percent-agreement-for-multiple-variables/m-p/259820#M57497</guid>
      <dc:creator>AZIQ1</dc:creator>
      <dc:date>2016-03-29T17:53:14Z</dc:date>
    </item>
  </channel>
</rss>

