*---------------------------------------------------------------------------- ; * program: sp.sas ; * purpose: estimates the proportions of positive agreement and negative ; * agreement and their asymptotic standard errors and confidence ; * intervals ; * author: John S. Uebersax ; ; * date: 14 Mar 2008 ; * rev: change(s): ; * --------- ---------------------------------------------------------------- ; * 07 oct 09 added comments ; * ; * usage: ; * user supplies frequencies of four-fold table: ; * ; * Rater 2 ; * + - ; * +-------+-------+ ; * + | a | b | ; * Rater 1 +-------+-------+ ; * - | c | d | ; * +-------+-------+ ; * ; * and interval width (e.g. 95 for 95% confidence interval ; * ; * references: ; * ; * Cicchetti DV. Feinstein AR. High agreement but low kappa: II. Resolving ; * the paradoxes. Journal of Clinical Epidemiology, 1990, 43, 551-558. ; * ; * Graham P, Bull B. Approximate standard errors and confidence intervals for ; * indices of positive and negative agreement. J Clin Epidemiol, 1998, 51(9), ; * 763-771. ; * ; * Mackinnon, A. A spreadsheet for the calculation of comprehensive statistics ; * for the assessment of diagnostic tests and inter-rater agreement. Computers ; * in Biology and Medicine, 2000, 30, 127-134. ; * ; * Spitzer R, Fleiss J. A re-analysis of the reliability of psychiatric ; * diagnosis. British Journal on Psychiatry, 1974, 341-47. ; *---------------------------------------------------------------------------- ; data one; **** supply these values, then run program ***; a = 10; b = 20; c = 30; d = 40; %let interval_width = 95 ; * begin computations ; p = &interval_width. / 100; z_crit = probit(1.0 - ((1.0 - p) / 2.)); Statistic = 'PA'; Estimate = (2*a) / (2*a + b + c) ; SE = (4*a *(c + b)*(a + c + b))**.5 / (2*a + b + c)**2 ; ll = estimate - z_crit * se; ul = estimate + z_crit * se; attrib CI label= "&interval_width.% CI"; CI = '(' || put(ll, 6.4) || ' - ' || put(ul, 6.4) || ')'; output; Statistic = 'NA'; Estimate = (2*d) / (2*d + b + c) ; se = (4*d *(c + b)*(d + c + b))**.5 / (2*d + b + c)**2 ; ll = estimate - z_crit * se; ul = estimate + z_crit * se; CI = '(' || put(ll, 6.4) || ' - ' || put(ul, 6.4) || ')'; output; keep statistic estimate se ci result; run; title "Proportions of Positive Agreement (PA) and Negative Agreement (NA)"; proc print data = one noobs label; run;