**************************************************************
* MACRO NAME: MKAPPASC.SPS *
* *
* README FILE: MKAPPASC.RM *
* *
* SPSS REQUIREMENTS: Release 4.0 or above *
* Advanced Statistics Module *
* *
* AUTHOR: David Nichols (nic...@spss.com) *
* *
* LAST UPDATED: 04/08/97 *
**************************************************************
preserve.
set printback=off mprint=off.
save outfile='ka__tmp1.sav'.
define mkappasc (vars=!charend('/')).
set mxloops=1000.
count ms__=!vars (missing).
select if ms__=0.
matrix.
get x /var=!vars.
compute c=mmax(x).
compute y=make(nrow(x),c,0).
loop i=1 to nrow(x).
loop j=1 to ncol(x).
loop k=1 to c.
do if x(i,j)=k.
compute y(i,k)=y(i,k)+1.
end if.
end loop.
end loop.
end loop.
compute pe=msum((csum(y)/msum(y))&**2).
compute k=ncol(x).
compute pa=mssq(y)/(nrow(y)*k*(k-1))-(1/(k-1)).
compute kstat=(pa-pe)/(1-pe).
compute num=2*(pe-(2*k-3)*(pe**2)+2*(k-2)*msum((csum(y)/msum(y))
&**3)).
compute den=nrow(y)*k*(k-1)*((1-pe)**2).
compute ase=sqrt(num/den).
compute z=kstat/ase.
compute sig=1-chicdf(z**2,1).
save {kstat,ase,z,sig} /outfile='ka__tmp2.sav'
/variables=kstat,ase,z,sig.
end matrix.
get file='ka__tmp2.sav'.
formats all (f11.8).
variable labels kstat 'Kappa' /ase 'ASE' /z 'Z-Value' /sig 'P-Value'.
report format=list automatic align(center)
/variables=kstat ase z sig
/title "Estimated Kappa, Asymptotic Standard Error,"
"and Test of Null Hypothesis of 0 Population Value".
get file='ka__tmp1.sav'.
!enddefine.
restore.
Lori,
The data need to be arranged with raters as columns (variables) and
the items, or subjects as rows (cases). The cell entries are the
categories that each rater assigned to each item. For example, if you
have four raters, then name the columns/variables rater1, rater2,
rater3, rater4. For each item that the four raters judged, enter the
category number they used in each cell. Make sure not to use 0 as a
category number, so if you had categories labeled 0 through 3, change
them to 1 through 4. After the last line in the macro, "restore", add
the line:
mkappasc vars= rater1 to rater4 . (or rater1 to whatever the highest
rater number is that you're using).
On the task bar at the top of the syntax page, click "Run", "All". If
you have difficulty, please contact me. I've written a number of
macros for interrater statistics, so I can probably get you through
this pretty easily. Good luck!
Brian
You specify the names of your variables when you call the macro.
E.g.,
mkappasc vars Var1 Var2 Var3 /.
But here's another option. The most common type of intraclass
correlation (ICC), and the default ICC computed by SPSS, is identical
to weighted kappa (with quadratic weights). If there are only 2
levels to the rating variable, then weighted kappa = kappa. You
didn't say how many levels there are to your rating variable, but if
2, you can just compute the ICC and call it a kappa. See
Biostatistics - The Bare Essentials (by Norman & Streiner) if you need
a reference to support this approach.
--
Bruce Weaver
bwe...@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."