Code for regression tree analysis