# CART and Clustered Data?

Just wonder if there is any caveat if one fits regular regression trees to clustered data but ignores the clustered structure of the data. More generally, how bad it would be if we fit regression trees to data in which the observations are not independent from each other (in terms of prediction accuracy, interpretation of the results...etc)?

We know that tree-based models are non-parametric, and there is no such thing as "violating the parametric assumption", which is the rationale for developing all the fancy models instead of just using OLS when the data is longitudinal or clustered. However, all the examples that I have come across when learning tree-based methods are based on cross-sectional data. I haven't come across any discussions on the potential consequences (in terms of prediction accuracy, ...etc.) if we ignore the clustered nature of the data. Any insight on this?

Several methods have been proposed to integrate tree-based models to mixed-effects regression models. However, it appeared to me that these methods were from a more regression-diagnostic point of view (e.g., Sela and Simonoff, 2012), and the scope and view may be different from what i am asking here. Their motivation was to use regress tree to account for the residuals; the tree was implemented after fitting a (linear) mixed-effects model. In other words, they first imposed a parametric structure to the data, fit the regression model, apply tree-based methods to analyze the residuals, and use the results from tree-based methods to improve the regression model estimates.

Finally, a bit background on my data: The response is a positive and continuous variable. There are about 350 clusters, each of which has 3 measurements. Thus there are 350x4 =1400 responses (balanced panel). There are about 20 predictors. The goal is to select the predictors that are strongly associated with the response.

• For me, Sela and Simonoff (2012) used trees to estimate the fixed-effects part and mixed-models to account for the clustering in the residuals. – Randel Nov 23 '15 at 21:36
• Just came across a paper by Bel and Allard (2009) that modifies the CART algorithm for clustered samples, which is common in ecological and environmental studies. Still, before adapting their algorithms, it would be great to know whether the CART is "good enough" or not for the current dataset which is a balanced panel. I do not have a good answer for this yet. – TCL Nov 24 '15 at 15:33
• Then why not start from random forest? – Randel Nov 24 '15 at 16:40
• Is random forest good at dealing with clustered data? – TCL Nov 24 '15 at 16:48
• See this. – Randel Nov 24 '15 at 16:53