[R] How to calculate confidence interval of C statistic by rcorr.cens
khosoda at med.kobe-u.ac.jp
khosoda at med.kobe-u.ac.jp
Sun May 22 10:11:40 CEST 2011
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,
More information about the R-help
mailing list