¡¡¤³¤ó¤Ë¤Á¤Ï¡£coo¤µ¤ó¤ÎÌÜŪ¤ËÌò¤ËΩ¤Á¤Þ¤·¤¿¤Ç¤·¤ç¤¦¤«¡©
¡¡¥·¥ó¥¿¥Ã¥¯¥¹¤Ë¤Ä¤¤¤Æ¤ÏËͤâ¾Ü¤·¤¯¤Ê¤¤¤Î¤Ç¤¹¤¬¡¢ÃΤäƤëÈϰϤǤÎ
ÄɲþðÊó¤Ç¤¹¡£
¡¡°Ê²¼¤Î¥·¥ó¥¿¥Ã¥¯¥¹¤ò¤¤¤¸¤ë¤È¤¹¤ë¤È¡¢°Ê²¼¤Î£²ÅÀ¤À¤±¤À¤È»×¤¤¤Þ¤¹¡£
¡¡¡Coo¤µ¤ó¤Î¥Ç¡¼¥¿¤ò¥¹¥Ú¡¼¥¹¶èÀÚ¤ê¤Çºî¤ê
¡ÖBEGIN DATA ¡×¡ÖEND DATA.¡×¤Î´Ö¤ËÆþ¤ì¤Þ¤¹¡£
¡¡Îã¤Ç¤Ï¡¢£µ¡ß£µ¤Ç¤·¤¿¤¬¡¢Ç¤°Õ¤Î¥µ¥¤¥º¤ÇOK¤Ç¤¹¡£
¢Îó¡ÊÊÑ¿ô¡Ë¤Î¿ô¤Ë¹ç¤ï¤»¤Æ¡¢
¡ÖDATA LIST LIST / x1 to x5.¡×
¡ÖGET x /var=x1 to x5. ¡×
¤Î£²¥«½ê¤òÊѤ¨¤ë
¡¡£·¤Ä¤ÎÊÑ¿ô¤Ê¤é¡¢ x1 to x7. ¤Ç¤¹¡£
£¤¢¤È¤Ï¡¢¤¹¤Ù¤Æ¼Â¹Ô¤ÇOK
¡¡
¡¡¥Ý¥¤¥ó¥È¤È¤·¤Æ¤Ï¡¢Ãæ´Ö½èÍý¤¬¸«¤¨¤¿Êý¤¬´Ö°ã¤¤¤¬¾¯¤Ê
¤¤¤Î¤Ç¡¢¤È¤³¤í¤É¤³¤í¤Ë¡Öprint¡×¥³¥Þ¥ó¥É¤Ç¡¢ÅÓÃæ·ë²Ì¤ò
½ÐÎϤ·¤Þ¤¹¡£
¡¡°Ê²¼¤ÎÎã¤Ï¡¢Àè¤Î¥·¥ó¥¿¥Ã¥¯¥¹¤Ë¡¢ÅÓÃæ·Ð²á¤Î½ÐÎϤò²Ã¤¨
¤¿¤â¤Î¤Ç¤¹¡£
¡¡¤´»²¹Í¤Þ¤Ç¤Ë(^¡û^)
* Read in the IxI matrix of counts for I-level scale.
DATA LIST LIST / x1 to x5.
BEGIN DATA
25 5 3 2 0
12 18 8 3 1
0 3 14 4 2
1 3 3 19 4
2 1 5 9 20
END DATA.
* Commands to compute weighted Kappa .
matrix.
GET x /var=x1 to x5.
print x.
compute wt1=make(nrow(x),ncol(x),0).
compute wt2=make(nrow(x),ncol(x),0).
compute prop=x/msum(x).
print wt1.
print wt2.
print prop.
loop i=1 to nrow(x).
loop j=1 to ncol(x).
compute wt1(i,j)=1-(abs(i-j)/(nrow(x)-1)).
compute wt2(i,j)=1-((i-j)/(nrow(x)-1))**2.
end loop.
end loop.
print wt1.
print wt2.
compute wk1num=msum(wt1&*prop)-msum(mdiag(rsum(prop))*wt1*mdiag(csum(prop))).
compute wk1den=1-msum(mdiag(rsum(prop))*wt1*mdiag(csum(prop))).
compute wk1=wk1num/wk1den.
print wk1num.
print wk1den.
print wk1.
compute wk2num=msum(wt2&*prop)-msum(mdiag(rsum(prop))*wt2*mdiag(csum(prop))).
compute wk2den=1-msum(mdiag(rsum(prop))*wt2*mdiag(csum(prop))).
compute wk2=wk2num/wk2den.
print wk2num.
print wk2den.
print wk2.
print wk1.
print wk2.
end matrix.