[R] How to calculate confidence interval of C statistic by rcorr.cens
Frank Harrell
f.harrell at vanderbilt.edu
Sun May 22 16:27:19 CEST 2011
S.D. is the standard deviation (standard error) of Dxy. It already includes
the effective sample size in its computation so the sqrt(n) terms is not
needed. The help file for rcorr.cens has an example where the confidence
interval for C is computed. Note that you are making the strong assumption
that there is no overfitting in the model or that you are evaluating C on a
sample not used in model development.
Frank
細田弘吉 wrote:
>
> 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.
More information about the R-help
mailing list