proc datasets library=WORK kill; run; quit; data ratings; input target J1 J2 J3 J4; datalines; 1 6 5.6 5 5 1 5 5 5 5 1 5 5 5 4 5 6 6 5 5 5 5 5 5 5 5 5 5 5 4.5 4 6 6 5 5 4 5 5 5 5 4 5 5 5 5 2 6 6 5 5 2 5 5 5 5 2 5 5 5 5 3 6 6 5 5 3 5 5 5 5 3 3.5 3.8 3.6 4.3 ; ods pdf file="c:\kgwet\chap4\finncoeff.pdf" style=Ocean; proc iml; use ratings; read all var _NUM_ into mratings[colname=rNames]; close ratings; start finn(xratings); scores = t(unique(xratings[,2:ncol(xratings)])); qscores = nrow(scores); se2 = (qscores-1)*var(scores)/qscores; tarvec = t(unique(xratings[,1]));/*creates vector of unique target identifiers*/ ntarget = nrow(tarvec);*number of targets/subjects; rjudges = ncol(xratings)-1;*number of judges/raters; s2i_vec = repeat(0,ntarget); do itar=1 to ntarget; idx = loc(xratings[,1]=tarvec[itar]); tar_mat = xratings[idx,][,2:rjudges+1]; s2i_vec[itar] = var(colvec(tar_mat)); end; s2 = s2i_vec[:]; fcoeff = 1-s2/se2; return(fcoeff||s2||se2); finish; fstats = finn(mratings); finn_coeff = fstats[1];s2=fstats[2];se2=fstats[3]; /* Computing the p-value of Finn's coefficient */ nboot = 2000; nrounds = nrow(mratings); scores = t(unique(mratings[,2:ncol(mratings)])); tarvec = t(unique(mratings[,1]));/*vector of subject ids */ ntarget = nrow(mratings);*number of targets/subjects; rjudges = ncol(mratings)-1;*number of judges/raters; pval = 0; do i=1 to nboot; bsample = mratings[,1]||sample(scores,rjudges||nrounds); finnstats = finn(bsample); if finnstats[1]>fcoeff then pval=pval+1; end; print mratings s2 se2 finn_coeff pval; quit; ods pdf close;