Hello
I am trying to calculate the confidence interval for the agreement observed in the Kappa analysis.
If I run for example
data FatComp;
input Test Response Count;
datalines;
0 0 6
0 1 2
1 0 4
1 1 11
;
proc sort data=FatComp;
by descending Test descending Response;
run;
proc freq data=FatComp order=data;
weight Count;
tables Test*Response / AGREE(KAPPADETAILS) ;
run;
I get that for the Kappa statistic, I get the confidence interval. But I would also like to obtain the confidence interval for the observed agreement (in Kappa Details 0.7391).
First I thought it would be like the confidence interval of a proportion (P + -1.96 * SQR (p (1-p) / N), but it isn't ... any ideas?
Thanks ¡
The point estimate of observed agreement is fixed by the row and column totals. I don't see any easy way to calculate the standard error based on this other than the method you propose. You have the estimate for p, so now it boils down to what N to use. I would be tempted to use the sum of the diagonals (N=17) which is the agreement numerator. From that I get, LB=0.7391 - 1.96 * sqrt (0.7391 * 0.2609/17) = 0.5304. For the UB I get 0.7391 + 1.96*(0.7391*0.2609/17) = 0.9479. Does this make sense? The interval would be narrower for N as the total = (0.5597, 0.9186).
SteveDenham
Observed agreement (the sum of the diagonal proportions in the crosstabs table) is also referred to as accuracy. This SAS Usage Note (Estimating sensitivity, specificity, positive and negative predictive values, and other statistics) shows how to create the corresponding binary variable for accuracy and then use the BINOMIAL option to get confidence limits and tests. From the usage note,
data acc;
set FatComp;
acc = (test = response);
run;
proc freq;
tables acc / binomial(level="1");
weight count;
run;
You can also use the BINOMIAL(CL=type) option to specify the confidence limit type (for example, Agresti-Coull, Wilson, etc.).
For 2x2 tables, the SENSPEC option (in the PROC FREQ TABLES statement) now includes accuracy together with confidence limits in the Sensitivity and Specificity table.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.
Find more tutorials on the SAS Users YouTube channel.