<?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 kappa calculation and QC in decimal place in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/kappa-calculation-and-QC-in-decimal-place/m-p/843274#M82245</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data FatComp;
         input Test Response Count;
         datalines;
1 1  130
1 0  20
0 1  40
0 0  160
;
/*******************************************************************************************
** kappa 
*******************************************************************************************/

data kappa1;
	a=130; b=20; c=40; d=160;
	p0=(a+d)/(a+b+c+d);
	pe=((a+b)*(a+c)+(d+b)*(d+c))/(a+b+c+d)**2;
	se=sqrt((p0*(1-p0)/(1-pe)**2)/(a+b+c+d));
	kappa=(p0-pe)/(1-pe);

	z=PROBIT(1-0.05/2);
	kappa_low=kappa-z*se;
	kappa_high=kappa+z*se;
run;



/*ods trace on;*/
ods output KappaStatistics=Kappa2;
proc freq data=FatComp;
	weight count/zeros;
	tables Test*Response/agree;
/*	test kappa wtkap;*/
/*	exact kappa ;*/
run; 
/*ods trace off;*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="blueskyxyz_0-1667961482723.png" style="width: 544px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77102i9D62DB09E9692B51/image-dimensions/544x93?v=v2" width="544" height="93" role="button" title="blueskyxyz_0-1667961482723.png" alt="blueskyxyz_0-1667961482723.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hi sasusers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please take a look at my code to calculate kappa,&amp;nbsp; the CI value is a little bit different between kappa1 and kappa2 while the estimate is almost same, so how to modify the code ( get the simple kappa in data step with the formula) to have the same result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;use two methods to double qc the kappa, I want get a 100% equal compare report, BTW, how to get the weight kappa using proc freq in SAS9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Sky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Nov 2022 02:43:11 GMT</pubDate>
    <dc:creator>blueskyxyz</dc:creator>
    <dc:date>2022-11-09T02:43:11Z</dc:date>
    <item>
      <title>kappa calculation and QC in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/kappa-calculation-and-QC-in-decimal-place/m-p/843274#M82245</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data FatComp;
         input Test Response Count;
         datalines;
1 1  130
1 0  20
0 1  40
0 0  160
;
/*******************************************************************************************
** kappa 
*******************************************************************************************/

data kappa1;
	a=130; b=20; c=40; d=160;
	p0=(a+d)/(a+b+c+d);
	pe=((a+b)*(a+c)+(d+b)*(d+c))/(a+b+c+d)**2;
	se=sqrt((p0*(1-p0)/(1-pe)**2)/(a+b+c+d));
	kappa=(p0-pe)/(1-pe);

	z=PROBIT(1-0.05/2);
	kappa_low=kappa-z*se;
	kappa_high=kappa+z*se;
run;



/*ods trace on;*/
ods output KappaStatistics=Kappa2;
proc freq data=FatComp;
	weight count/zeros;
	tables Test*Response/agree;
/*	test kappa wtkap;*/
/*	exact kappa ;*/
run; 
/*ods trace off;*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="blueskyxyz_0-1667961482723.png" style="width: 544px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77102i9D62DB09E9692B51/image-dimensions/544x93?v=v2" width="544" height="93" role="button" title="blueskyxyz_0-1667961482723.png" alt="blueskyxyz_0-1667961482723.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hi sasusers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please take a look at my code to calculate kappa,&amp;nbsp; the CI value is a little bit different between kappa1 and kappa2 while the estimate is almost same, so how to modify the code ( get the simple kappa in data step with the formula) to have the same result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;use two methods to double qc the kappa, I want get a 100% equal compare report, BTW, how to get the weight kappa using proc freq in SAS9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Sky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 02:43:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/kappa-calculation-and-QC-in-decimal-place/m-p/843274#M82245</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2022-11-09T02:43:11Z</dc:date>
    </item>
    <item>
      <title>kappa calculation and QC in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/kappa-calculation-and-QC-in-decimal-place/m-p/843276#M82247</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/*test data*/&lt;BR /&gt;data FatComp;
         input Test Response Count;
         datalines;
1 1  130
1 0  20
0 1  40
0 0  160
;
/*******************************************************************************************
** kappa 
*******************************************************************************************/

data kappa1;
	a=130; b=20; c=40; d=160;
	p0=(a+d)/(a+b+c+d);
	pe=((a+b)*(a+c)+(d+b)*(d+c))/(a+b+c+d)**2;
	se=sqrt((p0*(1-p0)/(1-pe)**2)/(a+b+c+d));
	kappa=(p0-pe)/(1-pe);

	z=PROBIT(1-0.05/2);
	kappa_low=kappa-z*se;
	kappa_high=kappa+z*se;
run;



/*ods trace on;*/
ods output KappaStatistics=Kappa2;
proc freq data=FatComp;
	weight count/zeros;
	tables Test*Response/agree;
/*	test kappa wtkap;*/
/*	exact kappa ;*/
run; 
/*ods trace off;*/&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="blueskyxyz_0-1667961482723.png" style="width: 544px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/77102i9D62DB09E9692B51/image-dimensions/544x93?v=v2" width="544" height="93" role="button" title="blueskyxyz_0-1667961482723.png" alt="blueskyxyz_0-1667961482723.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;hi sasusers,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;please take a look at my code to calculate kappa,&amp;nbsp; the CI value is a little bit different between kappa1 and kappa2 while the estimate is almost same, so how to modify the code ( get the simple kappa in data step with the formula) to have the same result.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;use two methods to double qc the kappa, I want get a 100% equal compare report, BTW, how to get the weight kappa using proc freq in SAS9.4.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;Sky.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 02:45:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/kappa-calculation-and-QC-in-decimal-place/m-p/843276#M82247</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2022-11-09T02:45:17Z</dc:date>
    </item>
    <item>
      <title>Re: kappa calculation and QC in decimal place</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/kappa-calculation-and-QC-in-decimal-place/m-p/844900#M82297</link>
      <description>the  formula  is not right, will update later</description>
      <pubDate>Thu, 17 Nov 2022 15:19:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/kappa-calculation-and-QC-in-decimal-place/m-p/844900#M82297</guid>
      <dc:creator>blueskyxyz</dc:creator>
      <dc:date>2022-11-17T15:19:40Z</dc:date>
    </item>
  </channel>
</rss>

