[R] Boot package

Prof Brian Ripley ripley at stats.ox.ac.uk
Wed Apr 21 13:30:22 CEST 2004


Some bootstrap resamples are giving infinite results for the first 
component of the statistic. That can certainly happen, given the censoring 
pattern.  Here is one such bootstrap resample

   time cens group
20    5    1     2
17    8    1     2
19    8    1     2
23   12    1     2
6    13    1     1
3    13    0     1
13   13    0     2
12   16    0     2
5    18    1     1
10   23    1     1
14   23    1     2
18   30    1     2
21   30    1     2
22   30    1     2
1    31    1     1
7    34    1     1
15   43    1     2
16   45    1     2
2    45    0     1
4    45    0     1
9    45    0     1
8   161    0     1
11  161    0     1

Note that 6/11 of the group 1 samples were censored, so the median
survival time is estimated to be infinite.


On Wed, 21 Apr 2004, Jingky Lozano wrote:

> Dear mailing list,
> 
> I tried to run the example for the conditional bootstap written in the help file
> of censboot.  I got the following result:
> 
> STRATIFIED CONDITIONAL BOOTSTRAP FOR CENSORED DATA
> 
> 
> Call:
> censboot(data = aml, statistic = aml.fun, R = 499, F.surv = aml.s1, 
>     G.surv = aml.s2, strata = aml$group, sim = "cond")
> 
> 
> Bootstrap Statistics :
>     original    bias    std. error
> t1*       31       Inf         NaN
> t2*       23 -2.058116    8.670602
> 
> 
> *****
> I don't know if there is something in the given code that results in "Inf" and
> "NaN" result. 

So you could do what I did, and get aml.fun to print out it's input and 
output.

> I tried a different data, analyzing it without stratification. 
> I got a different error:
> 
> > data.s1 <- survfit(Surv(time,cens), data=dataset)
> > data.s2 <- survfit(Surv(time-0.001*cens,1-cens), data=dataset)
> > msurv.cond  <- censboot(data=dataset,statistic=data.fun,R=r,
> F.surv=data.s1,G.surv=data.s2,sim="cond")
> Error in sample(length(x), size, replace, prob) : 
>         invalid first argument

You need to recompute the whole examples, and probably you have not done 
so.

> Can the boot package also output standard error and bias of the regression
> coefficients if I do a cox proportional hazard analysis applying all the
> different bootstrap methods for censored data??? I did a trial and error with
> my codes but it all got muddled in the end giving me nothing.  

You can, but you do need to understand what you are doing here.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list