When running Bin Chen's MKAPPA macro, I get an error, but I am not sure why. Specifically I am wondering whether I am not using the macro correctly.
My data set is attached. There are 13 raters who rated 320 subjects on a 4-point ordinal scale. (This is after I removed subjects with only one rater.)
My code
%include "\path\to\mkappa.sas"; /* from http://www2.sas.com/proceedings/sugi30/155-30.pdf */
%let dloc = c:\temp;
%let dset = rating_smile_transposed ;
%let Nrater = 13;
%let Ncat = 4;
%let outfile = output.rtf ;
%mkappa;
The error
MPRINT(MKAPPA): data kap.koutput;
MPRINT(MKAPPA): set final;
MPRINT(MKAPPA): keep Kappa SE pvalue;
MPRINT(MKAPPA): Kappa=num/den;
MPRINT(MKAPPA): SE=sqrt(2*(den*den-pqpsum))/(den*sqrt( 320*13*(13-1)));
MPRINT(MKAPPA): pvalue=1-probnorm(kappa/se);
MPRINT(MKAPPA): run;
NOTE: Invalid argument to function SQRT(-0.290557332) at line 34 column 174.
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 pqpsum=0.20087299 Kappa=0.0702069801 SE=. pvalue=. _ERROR_=1 _N_=1