Description Usage Arguments Details Value Author(s) See Also Examples

Computes Somers' Dxy rank correlation between a variable `x`

and a
binary (0-1) variable `y`

, and the corresponding receiver operating
characteristic curve area `c`

. Note that `Dxy = 2(c-0.5)`

.
`somers`

allows for a `weights`

variable, which specifies frequencies
to associate with each observation.

1 |

`x` |
typically a predictor variable. |

`y` |
a numeric outcome variable coded |

`weights` |
a numeric vector of observation weights (usually frequencies). Omit or specify a zero-length vector to do an unweighted analysis. |

`normwt` |
set to |

`na.rm` |
set to |

The `rcorr.cens`

function, which although slower than `somers2`

for large
sample sizes, can also be used to obtain Dxy for non-censored binary
`y`

, and it has the advantage of computing the standard deviation of
the correlation index.

a vector with the named elements `C`

, `Dxy`

, `n`

(number of non-missing
pairs), and `Missing`

. Uses the formula
`C = (mean(rank(x)[y == 1]) - (n1 + 1)/2)/(n - n1)`

, where `n1`

is the
frequency of `y=1`

.

Frank Harrell

Department of Biostatistics

Vanderbilt University School of Medicine

[email protected]

1 2 3 4 5 6 7 8 9 10 11 12 |

harrelfe/Hmisc documentation built on Oct. 3, 2019, 9:34 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.