[R] Trouble Using Boot Package Also

A Daniels adaniels100 at yahoo.com
Sat Jun 26 08:16:32 CEST 2004


Dear Help List,

I'm not an R-pro.  I just decided to try it because of
the many available advanced analysis packages. I
wonder if any of you have encountered this type of
error message in bootstrapping the median survival
time.  I couldn't seem to find a problem with the
command which I just patterned from the help files.

I hope you could take a look at this.  Much thanks for
any help.

A.Daniels


> data.f<-function(data){
+ s<-survfit(Surv(data$time,data$cens))
+ m<-min(s$time[s$surv<0.5])
+ }
> s1<-survfit(Surv(time,cens),data=abc)
> s2<-survfit(Surv(time-0.001*cens,1-cens),data=abc)
> med.cond<-censboot(data=abc,
statistic=data.f,R=499,F.surv=s1,G.surv=s2,sim="cond")
Error in sample(length(x), size, replace, prob) : 
        invalid first argument
> abc
   time cens group
1     9    1     1
2    13    1     1
3    13    0     1
4    18    1     1
5    23    1     1
6    28    0     1
7    31    1     1
8    34    1     1
9    45    0     1
10   48    1     1
11   48    0     1
12    5    1     2
13    5    1     2
14    8    1     2
15    8    1     2
16   12    1     2
17   16    0     2
18   23    1     2
19   27    1     2
20   30    1     2
21   33    1     2
22   43    1     2
23   45    1     2
>




More information about the R-help mailing list