Shamelessly copied from SAS documentation,
"A pair of observations with different observed responses is said to be concordant if the observation with the lower ordered response value has a lower predicted mean score than the observation with the higher ordered response value. If the observation with the lower ordered response value has a higher predicted mean score than the observation with the higher ordered response value, then the pair is discordant. If the pair is neither concordant nor discordant, it is a tie. Enumeration of the total numbers of concordant and discordant pairs is carried out by categorizing the predicted mean score into intervals of length and accumulating the corresponding frequencies of observations. Note that the length of these intervals can be modified by specification of the BINWIDTH= option in the MODEL statement. "
So, it's easy to calcuate the percentages by yourself. Just keep in mind a pair ties if the predicted probability lies in the same BIN.
- data vaso;
- length Response $12;
- input Volume Rate Response @@;
- LogVolume=log(Volume);
- LogRate=log(Rate);
- datalines;
- 3.70 0.825 constrict 3.50 1.09 constrict
- 1.25 2.50 constrict 0.75 1.50 constrict
- 0.80 3.20 constrict 0.70 3.50 constrict
- 0.60 0.75 no_constrict 1.10 1.70 no_constrict
- 0.90 0.75 no_constrict 0.90 0.45 no_constrict
- 0.80 0.57 no_constrict 0.55 2.75 no_constrict
- 0.60 3.00 no_constrict 1.40 2.33 constrict
- 0.75 3.75 constrict 2.30 1.64 constrict
- 3.20 1.60 constrict 0.85 1.415 constrict
- 1.70 1.06 no_constrict 1.80 1.80 constrict
- 0.40 2.00 no_constrict 0.95 1.36 no_constrict
- 1.35 1.35 no_constrict 1.50 1.36 no_constrict
- 1.60 1.78 constrict 0.60 1.50 no_constrict
- 1.80 1.50 constrict 0.95 1.90 no_constrict
- 1.90 0.95 constrict 1.60 0.40 no_constrict
- 2.70 0.75 constrict 2.35 0.03 no_constrict
- 1.10 1.83 no_constrict 1.10 2.20 constrict
- 1.20 2.00 constrict 0.80 3.33 constrict
- 0.95 1.90 no_constrict 0.75 1.90 no_constrict
- 1.30 1.625 constrict
- ;
- proc logistic data=vaso;
- model Response=LogRate LogVolume/binwidth=0.1;
- output out=xxx predicted=phat;
- run;
- proc sql;
- create table pairs as
- select ceil(10*a.phat) as rank0, ceil(10*b.phat) as rank1
- from xxx a, xxx b
- where a.response like 'n%' and b.response like 'c%';
- quit;
- data hell;
- set pairs nobs=denominator end=last;
- if rank0=rank1 then tied+1;
- else if rank0<rank1 then concordant+1;
- else discordant + 1;
- if last then do;
- p_tied = tied/denominator;
- p_concordant = concordant/denominator;
- p_discordant = discordant/denominator;
- output;
- end;
- keep tied concordant discordant p_:;
- label p_tied = '% tied' p_concordant='% concordant'
- p_discordant='% discordant';
- format p_: percent7.1;
- proc print label;
复制代码Example copythefted from
http://support.sas.com/documenta ... ogistic_sect064.htm