[R] validate (package Design): error message "subscript out of bounds"
Dirk Eddelbuettel
edd at debian.org
Tue Aug 28 15:22:37 CEST 2007
On 28 August 2007 at 08:04, Frank E Harrell Jr wrote:
| Wentzel-Larsen, Tore wrote:
| > Thanks,
| > I use Design version 2.1-1 (and as provided, R 2.5.1 on Windows XP).
|
| Sorry I missed the latter.
|
| > The redundancies in object names were for my own convience, as part of
| > a larger command file, and the validation of this univariate model was
| > only included to ease comparison with the main multivariate model. I have
|
| A minor point: adding more variables to the right hand side makes the
| model a multivariable model. It is still univariate as it has only one
| dependent variable.
|
| > tried to access Design version 2.0_12, but only managed to access version
| > 2.1_1 of Design in my Windows implementation of R2.5.1 (the choice of
| > operative system is made by my institution and I am only entitled to use
| > Windows).
|
| My mistake again. I forgot that the Debian repositories for CRAN are
| behind.
In which way? I se that ...
edd at ron:~$ wajig policy r-cran-design
r-cran-design:
Installed: (none)
Candidate: 2.1-1-1
Version table:
2.1-1-1 0
500 http://ron testing/main Packages
-1 http://ron unstable/main Packages
edd at ron:~$ wajig policy r-cran-hmisc
r-cran-hmisc:
Installed: 3.4-2-2
Candidate: 3.4-2-2
Version table:
*** 3.4-2-2 0
500 http://ron testing/main Packages
-1 http://ron unstable/main Packages
100 /var/lib/dpkg/status
edd at ron:~$
... both Hmisc and Design are at current version in both testing and
unstable, and these are the versions on CRAN. What am I missing?
Thanks, Dirk
|
| Frank
|
| > Best, Tore
| >
| > -----Opprinnelig melding-----
| > Fra: Frank E Harrell Jr [mailto:f.harrell at vanderbilt.edu]
| > Sendt: 28. august 2007 03:17
| > Til: Wentzel-Larsen, Tore
| > Kopi: r-help at stat.math.ethz.ch
| > Emne: Re: [R] validate (package Design): error message "subscript out of bounds"
| >
| > Wentzel-Larsen, Tore wrote:
| >> Dear R users
| >>
| >> I use Windows XP, R2.5.1 (I have read the posting guide, I have
| >> contacted the package maintainer first, it is not homework).
| >>
| >> In a research project on renal cell carcinoma we want to compute
| >> Harrell's c index, with optimism correction, for a multivariate
| >> Cox regression and also for some univariate Cox models.
| >> For some of these univariate models I have encountered an error
| >> message (and no result produced) from the function validate i
| >> Frank Harrell's Design package:
| >>
| >> Error in Xb(x[, xcol, drop = FALSE], coef, non.slopes, non.slopes.in.x, :
| >> subscript out of bounds
| >>
| >> The following is an artificial example wherein I have been able to
| >> reproduce this error message (actual data has been changed to preserve
| >> confidentiality):
| >
| > I could not reproduce the error on R 2.5.1 on linux using version 2.0-12
| > of Design (you did not provide this information).
| >
| > Your code involved a good deal of extra typing. Here is a streamlined
| > version:
| >
| > bc <- data.frame(time1 = c(9,24,28,43,58,62,66,107,116,118,123,
| > 127,129,131,137,138,139,140,148,169,176,179,188,196,210,218,
| > ....
| > bc
| >
| > library(Design)
| >
| > dd <- with(bc, datadist(bc1, age, adjto.cat='first'))
| > options(datadist = 'dd')
| >
| > f <- cph(Surv(time1,status1) ~ bc1,
| > data = bc, x=TRUE, y=TRUE, surv=TRUE)
| > anova(f)
| > f
| > summary(f)
| >
| > val <- validate(f, B=200, dxy=TRUE)
| >
| > I don't get much value of putting the type of an object as part of the
| > object's name, as information within objects defines the object type/class.
| >
| > There is little reason to validate a one degree of freedom model.
| >
| > Frank
| >
| >> library(Design)
| >>
| >> # an example data frame:
| >> frame.bc <- data.frame(time1 = c(9,24,28,43,58,62,66,107,116,118,123,
| >> 127,129,131,137,138,139,140,148,169,176,179,188,196,210,218,
| >> 1,1,1,2,2,3,4,8,23,32,33,34,43,44,48,51,52,54,59,59,60,60,62,
| >> 65,65,68,70,72,73,74,81,84,88,98,99,106,107,115,115,117,119,
| >> 120,122,122,122,122,126,128,130,135,136,136,138,149,151,154,
| >> 157,159,161,164,164,164,166,172,172,176,179,180,183,183,184,
| >> 187,190,197,201,201,203,203,203,209,210,214,219,227,233,4,18,
| >> 49,113,147,1,1,2,2,2,2,2,3,4,6,6,6,6,6,6,6,6,9,9,9,9,9,10,10,
| >> 10,11,12,12,12,13,14,14,17,18,18,19,19,20,20,21,21,21,21,22,23,
| >> 23,24,28,28,29,29,32,34,35,38,38,48,48,52,52,54,54,56,64,67,67,
| >> 69,70,70,72,84,88,90,114,115,140,142,154,171,195),
| >> status1 = c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
| >> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
| >> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
| >> 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
| >> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
| >> 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
| >> 1,1,1,1,1),
| >> bc1 = factor(c(1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
| >> 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
| >> 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
| >> 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,
| >> 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
| >> 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2),
| >> labels=c('bc.1','bc.2')),
| >> age = c(58,68,23,20,50,43,41,69,20,48,19,27,39,20,65,49,70,59,31,43,25,
| >> 61,60,45,34,59,32,58,30,62,26,44,52,29,40,57,33,18,50,50,55,51,38,34,
| >> 69,56,67,38,66,21,48,39,62,62,29,68,66,19,60,39,55,42,24,29,56,61,40,
| >> 52,19,40,33,67,66,51,48,63,60,58,68,60,53,20,45,62,37,38,61,63,43,67,
| >> 49,39,43,67,49,69,32,37,32,63,33,47,66,39,23,57,26,61,20,49,69,30,40,
| >> 29,38,66,60,69,69,44,65,25,41,53,18,55,45,59,49,27,51,29,67,26,24,26,
| >> 47,23,50,27,35,45,32,26,45,45,63,39,39,22,38,27,31,27,49,65,66,49,39,
| >> 21,51,49,55,63,19,26,50,21,24,34,65,33,55,33,36,53,48,25,54,58,60,34,
| >> 47,23,34,60,39,34,22,30,41,55,64,48,34,54))
| >> frame.bc
| >>
| >> # preparing for a simple univariate Cox regression:
| >> dd.bc <- datadist(frame.bc[, c('bc1','age')], adjto.cat='first')
| >> options(datadist = 'dd.bc')
| >>
| >> # a univariate Cox regression:
| >> cph.bc <- cph(formula = Surv(time1,status1)~bc1,
| >> data = frame.bc, x=TRUE, y=TRUE, surv=TRUE)
| >> anova(cph.bc)
| >> cph.bc
| >> summary(cph.bc)
| >>
| >> # the validate command for the Cox model:
| >> val.cph.bc <- validate(cph.bc, B=200, dxy=TRUE , pr=TRUE)
| >>
| >> ----------------------
| >> Output from the validate command:
| >>
| >> training test
| >> Dxy -0.124360 -0.1423409
| >> R2 1.000000 1.0000000
| >> Slope 1.000000 0.7919584
| >> D 0.016791 0.0147536
| >> U -0.002395 0.0006448
| >> Q 0.019186 0.0141088
| >> training test
| >> Dxy -0.191875 -0.1423409
| >> R2 1.000000 1.0000000
| >> Slope 1.000000 0.8936724
| >> D 0.022397 0.0147536
| >> U -0.002339 0.0001367
| >> Q 0.024736 0.0146169
| >> training test
| >> Dxy -0.199514 -0.1423409
| >> R2 1.000000 1.0000000
| >> Slope 1.000000 0.8075246
| >> D 0.025717 0.0147536
| >> U -0.002447 0.0005348
| >> Q 0.028163 0.0142188
| >> Error in Xb(x[, xcol, drop = FALSE], coef, non.slopes, non.slopes.in.x, :
| >> subscript out of bounds
| >>
| >>
| >> Any help/suggestions will be highly appreciated.
| >>
| >>
| >> Sincerely,
| >> Tore Wentzel-Larsen
| >> statistician
| >> Centre for Clinical research
| >> Armauer Hansen house
| >> Haukeland University Hospital
| >> N-5021 Bergen
| >> tlf +47 55 97 55 39 (a)
| >> faks +47 55 97 60 88 (a)
| >> email tore.wentzel-larsen at helse-bergen.no
| >>
| >> ______________________________________________
| >> R-help at stat.math.ethz.ch 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 E Harrell Jr Professor and Chair School of Medicine
| Department of Biostatistics Vanderbilt University
|
| ______________________________________________
| R-help at stat.math.ethz.ch 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.
--
Three out of two people have difficulties with fractions.
More information about the R-help
mailing list