[R] Interpreting the example given by Prof Frank Harrell in {Design} validate.cph
vikkiyft
s067835 at alumni.cuhk.net
Mon Feb 21 18:26:28 CET 2011
Thank you very much Prof Harrell!
Sorry that I am new to this forum, and so ain't familiar with how to post
message appropriately.
I repeated the same procedure using a dataset from the {survival} package.
This time I used the {rms} package, and 100 bootstrap samples:
> library(rms)
> library(survival)
> attach(colon)
> S<-Surv(time,status)
> f<-cph(S~factor(obstruct)+factor(perfor)+factor(adhere)+factor(differ)+factor(extent)+factor(node4),x=T,y=T,surv=T)
> # no stratification
> set.seed(110221)
> validate(f,method="b",B=100,dxy=T,pr=F)
index.orig training test optimism index.corrected n
Dxy -0.2918 -0.2932 -0.2861 -0.0070 -0.2847 100
R2 0.1145 0.1191 0.1104 0.0088 0.1057 100
Slope 1.0000 1.0000 0.9626 0.0374 0.9626 100
D 0.0170 0.0178 0.0164 0.0014 0.0156 100
U -0.0002 -0.0002 0.0001 -0.0003 0.0001 100
Q 0.0172 0.0179 0.0162 0.0017 0.0155 100
g 0.5472 0.5590 0.5348 0.0242 0.5230 100
> f2<-cph(S~factor(obstruct)+factor(perfor)+factor(adhere)+factor(differ)+factor(extent)+factor(node4)+strat(rx),x=T,y=T,surv=T)
> # with stratification
> set.seed(110221)
> validate(f2,method="b",B=100,dxy=T,pr=F,u=30)
index.orig training test optimism index.corrected n
Dxy 0.1567 0.1966 0.1826 0.0140 0.1426 100
R2 0.1154 0.1191 0.1111 0.0081 0.1073 100
Slope 1.0000 1.0000 0.9720 0.0280 0.9720 100
D 0.0203 0.0210 0.0195 0.0015 0.0188 100
U -0.0002 -0.0002 0.0001 -0.0003 0.0001 100
Q 0.0205 0.0212 0.0193 0.0018 0.0186 100
g 0.5523 0.5591 0.5402 0.0189 0.5333 100
The same situation happened again. The Dxy's were all in opposite
directions.
In fact my case is even worse than these examples - the Dxy for
non-stratified model was -0.54 but the Dxy for stratified model was almost
+0.6; and the bootstrap validated R^2 was even negative!!
But..why does this happen??
Thanks a lot,
Vikki
--
View this message in context: http://r.789695.n4.nabble.com/Interpreting-the-example-given-by-Prof-Frank-Harrell-in-Design-validate-cph-tp3316820p3317743.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list