> On Mar 19, 2016, at 12:36 AM, Majid Javanmard <micka.young...@gmail.com> 
> wrote:
> 
> Hello everyone
> 
> here is the code that implements bagging using ipred package in R :
> 
> library(ipred)
> library(mlbench)
> data("BostonHousing")
> # Test set error (nbagg=25, trees pruned): 3.41 (Breiman, 1996a, Table 8)
> mod <- bagging(medv ~ ., data=BostonHousing, coob=TRUE)
> print(mod)
> pred <- predict(mod)
> pred<- as.data.frame(pred)
> 
> How can I have 95% Confidence interval for each predicted values !?

Perhaps you really mean prediction intervals, since none of those results 
really a parameters. I don't think it makes sense to talk about 95%CI's in the 
context of a bagging procedure because there really is no single model. In any 
case it has already been suggested that this is not really an R coding problem 
but rather a conceptual problem. You were advised to post further questions on 
stats.stackexchange.com (if you were unable to find an answered question), the 
first hit on a Google search for "confidence Interval randomForest":

 
http://stats.stackexchange.com/questions/56895/do-the-predictions-of-a-random-forest-model-have-a-prediction-interval

-- 

David Winsemius
Alameda, CA, USA

______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
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.

Reply via email to