Skip to content
Prev 237811 / 398500 Next

repeating an analysis

Andrew -
    I think

answer = replicate(50,{fit1 <- rpart(CHAB~.,data=chabun, method="anova",
                                      control=rpart.control(minsplit=10,
                                              cp=0.01, xval=10));
                                      x = printcp(fit1);
                                      x[which.min(x[,'xerror']),'nsplit']})

will put the numbers you want into answer, but there was no reproducible
example to test it on.  Unfortunately, I don't know of any way to 
surpress the printing from printcp().

 					- Phil Spector
 					 Statistical Computing Facility
 					 Department of Statistics
 					 UC Berkeley
 					 spector at stat.berkeley.edu
On Wed, 13 Oct 2010, Andrew Halford wrote: