[R] Multiple Reponse CART Analysis

From: Bardwell, Jeff H <Jeff_Bardwell_at_baylor.edu>
Date: Mon, 10 Dec 2007 14:17:38 -0600


Dear R friends-  

I'm attempting to generate a regression tree with one gradient predictor and multiple responses, trying to test if change in size (turtle.data$Clength) acts as a single predictor of ten multiple diet taxa abundances (prey.data) Neither rpart or mvpart seem to allow me to do multiple responses. (Or if they can, I'm not using the functions properly.)

> library(rpart)
> turtle.rtree<-rpart(prey.data~., data=turtle.data$Clength, method="anova", maxsurrogate=0, minsplit=8, minbucket=4, xval=10); plot(turtle.rtree); text(turtle.rtree)
Error in terms.formula(formula, data = data) :

        '.' in formula and no 'data' argument

When I switch response for predictor, it works. But this is the opposite of what I wanted to test and gives me splits at abundance values, not carapace length values.
> turtle.rtree<-rpart(turtle.data$Clength~., data=prey.data, method="anova", maxsurrogate=0, minsplit=8, minbucket=4, xval=10); plot(turtle.rtree); text(turtle.rtree)
>
 

I've heard polymars recommended for this sort of situation. I've downloaded the polyspline library, but get bogged down in the equation. Also, it doesn't seem like polymars will generate a tree even if I do get it working. Can rpart be modified in some way to accomodate multiple response parameters? If anyone's ever come across this situation before, pointers would be much appreciated. Thanks.  

Sincerely,
Jeff Bardwell     

Jeff H Bardwell, M.S.
Biology Department
ENV 1101 Lab Coordinator
Goebel 115, OH: Thu 1pm-4pm
710-6596 (e-mail preferred)



R-help_at_r-project.org mailing list
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. Received on Mon 10 Dec 2007 - 20:43:34 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 10 Dec 2007 - 23:30:19 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.