Added code to calculate mean residuals per plant and add to the predictions.