[R] cannot use simple=TRUE in boot

he chen chenhe.liz at gmail.com
Mon Jun 25 11:50:35 CEST 2012


Dear Rui,

Thanks. I check the spell in the code, no wrong (just spell wrong in
the error message). After I download the newest 2.15  version, the
code work fine with me, too. I guess it resulted from the old version
(2.7.1) I used.





2012/6/25 Rui Barradas <ruipbarradas at sapo.pt>:
> Hello,
>
> Your code works with me, unchanged:
>
>
>
>> boot<-boot(c,table,100, sim="ordinary", stype="i",simple=TRUE)
>> boot
>
> ORDINARY NONPARAMETRIC BOOTSTRAP
>
>
> Call:
> boot(data = c, statistic = table, R = 100, sim = "ordinary",
>    stype = "i", simple = TRUE)
>
>
> Bootstrap Statistics :
>    original  bias    std. error
> t1*    500.5 0.76209    8.876232
>
>
> But your error message shows a typo in 'simlpe' so, check your typing.
>
> Also, 'c', 'table' and 'boot' are really bad names for data objects or
> functions, they already are R functions.
>
> Hope this helps,
>
> Rui Barradas
>
> Em 25-06-2012 08:26, he chen escreveu:
>>
>> I am doing boot with a large database, thus want to use simple=TRUE to
>> reduce the memory used.
>> I alreday set up sim="ordinary", stype="i" , but I don't know how to
>> set "n=0". In fact, I don't know what does "n=0" mean?
>> For example,
>>
>> a<-c(1:1000)
>> b<-c(2:1001)
>> c<-cbind(a,b)
>>
>> library(boot)
>> table<-function(c,indices){
>>   d<-c[indices,]
>>   e<-mean(d[,1])
>>   return(e)
>> }
>>
>> boot<-boot(c,table,100, sim="ordinary", stype="i",simple=TRUE)
>>
>>
>> AND, r give "Error in statistic(data, original, ...) : unused
>> argument(s) (simlpe = TRUE)"
>>
>> Thanks a lot!
>>
>> ______________________________________________
>> R-help at r-project.org 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.
>>
>



-- 
Best Regards,
    Yours,
    Chen He

PhD Candidate
Institute of Population Research
Peking University, Beijing, China



More information about the R-help mailing list