Antonio Punzon Merino
2011-Dec-06 20:05 UTC
[R] varaince explined of a regression tree using ctree
Dear, I would like know the way to calculate the variance explained of a regression tree. I use the function "ctree" from library "party" many thanks [[alternative HTML version deleted]]
Patrick Breheny
2011-Dec-06 20:51 UTC
[R] varaince explined of a regression tree using ctree
On 12/06/2011 03:05 PM, Antonio Punzon Merino wrote:> I would like know the way to calculate the variance explained of a > regression tree. I use the function "ctree" from library "party"ctree does not provide this information by default, but it is not difficult to calculate: X <- matrix(rnorm(100*10),ncol=10) y <- X%*%c(rep(2,5),rep(0,5))+rnorm(100) fit <- ctree(y~.,data=as.data.frame(X)) r <- y - predict(fit) 1-var(r)/var(y) -- Patrick Breheny Assistant Professor Department of Biostatistics Department of Statistics University of Kentucky