Skip to content
Prev 77777 / 398502 Next

CART for 0/1 data

Martin,

     Sorry, I don't think I read your message carefully enough.

     When you say the error message is "+", that woudl seem to indicate 
that you still had an unclosed parenthesis and that the function was 
looking for more input.

     Using a smaller data set (160 samples, 169 rows, only 5 classes) it 
did work fine for me.  pa = presence/absence dataframe, opt.5$clustering 
= cluster IDs.

*********************************************************************

 > test <- tree(factor(opt.5$clustering)~pa)
 > test
node), split, n, deviance, yval, (yprob)
       * denotes terminal node

  1) root 160 371.000 3 ( 0.23750 0.08750 0.57500 0.07500 0.02500 )
    2) pa.symore < 0.5 79 216.500 1 ( 0.48101 0.17722 0.15190 0.13924 
0.05063 )
      4) pa.artarb < 0.5 42 123.600 2 ( 0.07143 0.33333 0.26190 0.23810 
0.09524 )
        8) pa.macgri < 0.5 31  75.280 2 ( 0.09677 0.45161 0.00000 
0.32258 0.12903 )
    .        .         .
    .        .         .
    .        .         .
    3) pa.symore > 0.5 81  10.780 3 ( 0.00000 0.00000 0.98765 0.01235 
0.00000 )
      6) pa.carrss < 0.5 11   6.702 3 ( 0.00000 0.00000 0.90909 0.09091 
0.00000 ) *
      7) pa.carrss > 0.5 70   0.000 3 ( 0.00000 0.00000 1.00000 0.00000 
0.00000 ) *

************************************************************************

I'll try agin with a larger dataset and see if it's a memory limitation.

Dave Roberts
Martin Wegmann wrote: