# Re: [R] How to calculate confidence interval of C statistic by rcorr.cens

From: Frank Harrell <f.harrell_at_vanderbilt.edu>
Date: Sun, 22 May 2011 07:27:19 -0700 (PDT)

>
> Hi,
>
> I'm trying to calculate 95% confidence interval of C statistic of
> logistic regression model using rcorr.cens in rms package. I wrote a
> brief function for this purpose as the followings;
>
> CstatisticCI <- function(x) # x is object of rcorr.cens.
> {
> se <- x["S.D."]/sqrt(x["n"])
> Low95 <- x["C Index"] - 1.96*se
> Upper95 <- x["C Index"] + 1.96*se
> cbind(x["C Index"], Low95, Upper95)
> }
>
> Then,
>

```>> MyModel.lrm.rcorr <- rcorr.cens(x=predict(MyModel.lrm), S=df\$outcome)
>> MyModel.lrm.rcorr

>        C Index            Dxy           S.D.              n

> missing     uncensored
>      0.8222785      0.6445570      0.1047916    104.0000000
> 0.0000000    104.0000000
> Relevant Pairs     Concordant      Uncertain
>   3950.0000000   3248.0000000      0.0000000
```
>
```>> CstatisticCI(x5factor_final.lrm.pen.rcorr)

>                       Low95   Upper95

```
> C Index 0.8222785 0.8021382 0.8424188
>
> I'm not sure what "S.D." in object of rcorr.cens means. Is this standard
> deviation of "C Index" or standard deviation of "Dxy"?
> I thought it is standard deviation of "C Index". Therefore, I wrote the
> code above. Am I right?
>
> I would appreciate any help in advance.
>
> --
> Kohkichi Hosoda M.D.
>
> Department of Neurosurgery,
> Kobe University Graduate School of Medicine,
>
> ______________________________________________
> R-help_at_r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

Frank Harrell
Department of Biostatistics, Vanderbilt University
```--
View this message in context: http://r.789695.n4.nabble.com/How-to-calculate-confidence-interval-of-C-statistic-by-rcorr-cens-tp3541709p3542163.html
Sent from the R help mailing list archive at Nabble.com.

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
```
Received on Sun 22 May 2011 - 14:29:50 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 22 May 2011 - 18:30:08 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.