BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
pau13rown
Lapis Lazuli | Level 10

i have two subgroups in my dataset, and i estimated kappa and obtained confidence intervals for each as per this code:

 

proc freq data=.... order=data ;
  tables var1*var2 / agree noprint;
  weight frequency / zeros;
run;

 

is it possible to test whether the agreement (as measured by kappa) is the same within these subgroups ie Ho: kappa1 = kappa2?

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

I assume you have a categorical variable (gender, race, political affiliation) that you want to use to see whether the kappa for one group (females) is equivalent to the kappa for the other group (males).

 

I'm not an expert on this topic, but run the following example to see if it gives you some helpful information. You can put the categorical variable FIRST on the TABLES statement to get analyses that control for each strata. You also get an analysis for the overall kappa:

 

data Have;
input Sex $ var1 $ var2 $ Frequency ;
datalines;
F A X 20
F A Y 30
F B X 20
F B Y 20
M A X 40
M A Y 60
M B X 20
M B Y 10
;

proc freq data=Have order=data ;
  tables sex*var1*var2 / agree ;
  weight frequency / zeros;
  test kappa;
run;

 

See the PROC FREQ doc, especially the sections "Overall Kappa Coefficient" and "Tests for Equal Kappa Coefficients."

View solution in original post

2 REPLIES 2
Rick_SAS
SAS Super FREQ

I assume you have a categorical variable (gender, race, political affiliation) that you want to use to see whether the kappa for one group (females) is equivalent to the kappa for the other group (males).

 

I'm not an expert on this topic, but run the following example to see if it gives you some helpful information. You can put the categorical variable FIRST on the TABLES statement to get analyses that control for each strata. You also get an analysis for the overall kappa:

 

data Have;
input Sex $ var1 $ var2 $ Frequency ;
datalines;
F A X 20
F A Y 30
F B X 20
F B Y 20
M A X 40
M A Y 60
M B X 20
M B Y 10
;

proc freq data=Have order=data ;
  tables sex*var1*var2 / agree ;
  weight frequency / zeros;
  test kappa;
run;

 

See the PROC FREQ doc, especially the sections "Overall Kappa Coefficient" and "Tests for Equal Kappa Coefficients."

pau13rown
Lapis Lazuli | Level 10

thanks!

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1394 views
  • 1 like
  • 2 in conversation