Skip to content
Prev 349943 / 398513 Next

BIG difficulties in Using boot.ci (bot package)

Hi Daniel,

Sorry for that, once more.... ;=(

Here is the reproducible code and this time IT WORKS FINALLY !!!

GDP.LOG <-c(14,12,13,15.5,16,17,16.5,13.5,12.5,12)  
Quality.score <-c(12,11,13,14,15,16,12,10,9,9) 
Competitivness.score=c(8,6,7,5,6.5,7,8,4.5,6,7) 
df=data.frame(GDP.LOG,Quality.score,Competitivness.score) 

fit <- lm(formula = GDP.LOG ~ Quality.score + Competitivness.score)  
install.packages("boot") 
library(boot) 
bs=function(formula,data,indices){ 
d=data[indices,] 
fit=lm(formula,data=d)
(coef(fit)) 
}  
results=boot(data=df,statistic=bs, R=2000,formula= GDP.LOG ~ 
Quality.score + Competitivness.score)  
boot.ci(results,type="bca",index=1)  
boot.ci(results,type="bca",index=2) 
boot.ci(results,type="bca",index=3) 

Best,
S



----- Mail original -----
De : Daniel Nordlund <djnordlund at frontier.com>
? : r-help at r-project.org
Cc : 
Envoy? le : Lundi 13 avril 2015 19h26
Objet : Re: [R] BIG difficulties in Using boot.ci (bot package)
On 4/13/2015 9:06 AM, varin sacha wrote:
The first problem is that this is not reproducible code.  This is what I 
get when I run your code on my computer:
+ d=data[indices,]
+ fit=lm(formula,data=d)
+ (coef(fit))
+ }
Error in NROW(data) : object 'Dataset' not found
Error in boot.ci(results, type = "bca", index = 1) :
   object 'results' not found
Error in boot.ci(results, type = "bca", index = 2) :
   object 'results' not found
Error in boot.ci(results, type = "bca", index = 3) :
   object 'results' not found
A reproducible example means that when I run your code on my machine, I 
get the same results / warnings / errors that you get.  I got something 
different.


Dan