Regression tree with nested data repeated in time (GLMERTREE, REEMTREE or REEMCTREE) I work on the predation of seeds by insects (carabidae), and I am particularly interested in the effect of community composition on predation. I would like to know if the best predation rates are associated with one (or two) species, or with a complex assemblage of species. 
For this reason I was interested in the regression tree. My data set consists of my response variable (predation rate between 0 and 1),

and the abundance of each species of beetle caught. 
The structure of my data is hierarchical, I have follow-ups in several projects (with slightly different protocols) in which several fields are followed. Field is nested in project. And the fields are tracked over time. 
I found several regression tree methods that include random effects: REEMtree, REEMctree and glmertree. 
I wish I'd known:


*

*if one of these methods is more appropriate than the others to my data

*how to write the random effect. I think it's: 1|Project/Time/Field
While trying the different methods I met some interrogations:


*The tree obtained with REEMtree is constantly changing. Is there a reason for that?

*With REEMctree the values predicted in my tree are no longer limited between 0 and 1

*With glmertree is it necessary to have a treatment variable? Or can I write: 
gt <- glmertree(TP_viola ~  1 |(1 | Data/Mois/Parcelle)| Harpalus + ... +
                Pterostichus, data = Compilation_zone_ap_genre_CP, family = "binomial")

Is there a way to include my predation rate in the form of cbind (consumed seeds, exposed seeds - consumed seeds). Because the number of exposed seeds change according to the projects.
 A: I haven't got a full answer but some comments with partial answers:


*

*The glmertree() function does not require a treatment effect or any other kind of slope parameter in each node of the tree. Thus, it is ok to use the tree to capture only changes in a piecewise constant mean - as you do in your formula.

*If you don't get a response about the REEMtree/REEMctree part, I recommend contacting the lead author Jeff Simonoff directly. I don't think he follows StackExchange.

*Your response TP_viola is a proportion but you use family = binomial which would usually expect a binary factor response. I would at least try whether the results are sufficiently stable when using something like factor(TP_viola > 0.5). Of course, it's not a good idea to binarize the response when more detailed data is available - but it might be useful as a robustness check. But it's also not good to simply go with a binomial model when you have a proportion. In the absence of random effects I would recommend beta regression but I don't think there is a readily available software combining beta regression, recursive partitioning, and mixed effects. Building blocks for this are around in R but would require some work...

