引导在R中生成相同的值
我在R中运行一个名为nes2的非参数引导程序。这是我的密码:引导在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
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