Programming the statistical procedures from SAS

Preparing variables for SAS mAGREE macro

Reply
Occasional Contributor
Posts: 5

Preparing variables for SAS mAGREE macro

Hey guys;

I am planning on using the SAS mAGREE macro to calculate Kappa statistics for four raters and four categories. However, the mAGREE macro only accepts one variable for the rater identities and one variable for the ratings.

Ex. %mAGREE (data=<input dataset> items=<subject identifier variable> raters=<rater identifier variable> response=<ratings variable>)

In my data set, my raters' identities are represented by each of four variables' names and the ratings are the values for that variable. For example:

Observation           Rater 1          Rater 2          Rater 3          Rater 4

1                         1                    1                    2               2

2                         3                    2                    2               3

3                         4                    2                    3               4

4                         2                    1                    3               2

.

.

.

So my question is, how do I set it up so that the ratings provided by each rater for each observation is included in one variable's values (or more simply, how do I collapse the ratings from each of the four raters into one response variable)? Thanks.

Esteemed Advisor
Posts: 7,085

Re: Preparing variables for SAS mAGREE macro

Sounds like the following might be a better choice: http://www2.sas.com/proceedings/sugi30/155-30.pdf

Occasional Contributor
Posts: 5

Re: Preparing variables for SAS mAGREE macro

Hi, thanks for replying. Unfortunately, I tried using that macro and had trouble running it as well. I thought the macro provided by SAS may have been easier...

Grand Advisor
Posts: 9,463

Re: Preparing variables for SAS mAGREE macro

Not sure. If it could work:

array x{*}  Rater 1          Rater 2          Rater 3          Rater 4 ;

do i=1 to dim(x);

rater=vname(x{i});

ratings=x{i};

output;

end;

Occasional Contributor
Posts: 5

Re: Preparing variables for SAS mAGREE macro

Thanks!

Esteemed Advisor
Posts: 7,085

Re: Preparing variables for SAS mAGREE macro

Here is one more paper you might want to look at: http://analytics.ncsu.edu/sesug/2012/PO-05.pdf

They show a data layout, and macros, for calculating a Kappa for 4 raters with each subject having a number of observations.

Occasional Contributor
Posts: 5

Re: Preparing variables for SAS mAGREE macro

Thanks!

Ask a Question
Discussion stats
  • 6 replies
  • 605 views
  • 6 likes
  • 3 in conversation