[R] use of "rcorr.cens" with binary response?

Frank E Harrell Jr f.harrell at vanderbilt.edu
Fri Jun 4 19:02:19 CEST 2004


Tom Vanwalleghem wrote:
> Dear R-helpers,
> 
> I recently switched from SAS to R, in order to model the occurrence of
> rare events through logistic regression.
> Is there a package available in R to calculate the Goodman-Kruskal
> Gamma?
> After searching a bit I found a function "rcorr.cens" which should do
> the job, but it is not clear to me how to define the input vectors? Is
> "x" a vector with the fitted probabilities and "s" a vector containing
> the observed response variable? Or does anybody know an alternative?
> 
> Any help would be greatly appreciated,
> Thanks,
> Tom
> --
> Tom Vanwalleghem
> Physical and Regional Geography, K.U.Leuven
> Redingenstraat 16
> B-3000 LEUVEN
> +32(0)16/326414
> 

If dealing with a binary response, Somers' Dxy rank correlation may have 
a slight advantage over gamma.  You can get Dxy from somers2 in Hmisc 
and from that you can easily compute ROC area (Dxy = 2*(ROC - .5)). 
rcorr.cens thought will also give standard errors.  You are right about 
the inputs except that x can be probability or log odds - anything that 
ranks the same as probability.

-- 
Frank E Harrell Jr   Professor and Chair           School of Medicine
                      Department of Biostatistics   Vanderbilt University




More information about the R-help mailing list