Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/77.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
引导在R中生成相同的值_R_Statistics Bootstrap - Fatal编程技术网

引导在R中生成相同的值

引导在R中生成相同的值,r,statistics-bootstrap,R,Statistics Bootstrap,我在R中运行一个名为nes2的非参数引导程序。这是我的密码: co.store <- NULL for(i in 1:500){ #we do this 500 times dat.bs <- nes2[sample(c(1:nrow(nes2)),nrow(nes2),replace=T),] #sampling that I did before. New data set logit.bs <- glm(formula=bs.model,data=dat.bs,f

我在R中运行一个名为nes2的非参数引导程序。这是我的密码:

co.store <- NULL
for(i in 1:500){ #we do this 500 times
  dat.bs <- nes2[sample(c(1:nrow(nes2)),nrow(nes2),replace=T),] #sampling that I did before. New data set
  logit.bs <- glm(formula=bs.model,data=dat.bs,family=binomial(link="logit")) #run logit with new data set
  co <- coefficients(logit.bs) #get coeff
  co.store <- rbind(co.store,co) #store coeff, rbind instead of c in order to have a stack of numbers. 

}

co.store请让您的示例重现。我们需要
nes2
bs.model
来掌握正在发生的事情。型号是bs。模型是bs.model Paula,你能编辑你的问题以添加你评论中的代码吗。如果您在模型中使用
nes2$
,则不会使用新的引导示例<代码>bs.model
应该类似于
bs.model请让您的示例重现。我们需要
nes2
bs.model
来掌握正在发生的事情。型号是bs。模型是bs.model Paula,你能编辑你的问题以添加你评论中的代码吗。如果您在模型中使用
nes2$
,则不会使用新的引导示例<代码>bs.model
应该类似于
bs.model