Each subject represents a rater. I want to know the agreement for the raters for each test. Why am I getting negatives for the Fleiss' kappa for each of the 9
tests? The score for each test is between 1-9.
// Step 0: example data clear input rad xm1 xm2 xm3 xm4 xm5 1 1 4 3 2 1 2 2 4 2 2 1 3 1 3 3 1 1 end // here is the dataset list
// Step 1: get into shape reshape long xm , i(rad) // look what this has done list // now adjust the names rename (rad _j xm) (_j xm rad) // and look again list // now reshape back reshape wide rad , i(xm) j(_j) // and look at the final result list
// Step 2: calculate kappa kap rad1-rad3
ssc install kappaetc kappaetc rad1-rad3 , wgt(linear)
kap test1-test9
bysort subject , rc0 : kappaetc rater1-rater55
// number of raters local R 55 // number of categories local C 9 // --------------------------------------------------------------------- // how many times can the categries be repeated? local full_categories = floor(`R'/`C') // how many categories are left over; cannot be repeated? local left_categories = mod(`R', `C') // combinations for full categories local full = (`C'-`left_categories')*max(0, comb(`full_categories', 2)) // combinations for the left categories local left = `left_categories'*max(0, comb((`full_categories'+1), 2)) // fraction of total display (`full'+`left') / comb(`R', 2)
. // fraction of total . display (`full'+`left') / comb(`R', 2) .09494949
subject test1 test2 test3 test4 test5 1 2 3 2 3 2 2 2 2 2 2 3 3 2 2 2 2 3
kap test1-test55
There are 55 raters per subject: Outcome | Kappa Z Prob>Z -----------------+------------------------------- 1 | 0.0583 6.74 0.0000 2 | 0.0060 0.69 0.2447 3 | 0.0742 8.57 0.0000 7 | -0.0020 -0.23 0.5925 -----------------+------------------------------- combined | 0.0440 6.65 0.0000
Comment