3

I have the following mixed effects model with two crossed random effects which I am using to model tree growth:

Model <- lmer (log(Growth) ~ log(Size) + log(Competition) + (1 + log(Size) | Treatment) + (1 | Plot))

I am using this model to predict new data, and was glad to see that the development version of lme4 now comes with a predict function that allows both fixed and random effects to be used to generate predictions. However I also need to be able to estimate the uncertainty in the predictions I am making, which is a problem since predict in lme4 doesn't generate SE for predictions.

I have tried to alternative approached. The first was to use simulate to generate a distribution of predicted values which I could then summarize into uncertainty estimates. However, I found that the output of simulate is clearly different from that of predict, regardless of how I treated the use.u argument relating to random effects. When I take the mean predicted value across 1000 or more simulations and compare it to the output of predict, it is clear that the two methods are producing different results.

The second approach was to use the bootMer function as recommended in the help file for predict. From this I was able to obtain SE for the parameter estimates. However, I'm not quite sure how to then translate these into uncertainty in the predictions (i.e., how do I obtain SEs for the predicted values?). Am I missing something obvious?

Any help/advice on the two approaches I have used would be much appreciated, as would any suggestions on alternatives I have not considered!

StupidWolf
  • 45,075
  • 17
  • 40
  • 72
  • It is not obvious to me what exactly you are predicting: Are you predicting for a specific treatment and a specific plot? Or for a specific treatment and the plot population? Possibly related: [Extract prediction band from lme fit](http://stackoverflow.com/a/14435982/1412059) (including links and comments). – Roland Jul 31 '13 at 12:12
  • 1
    Sorry for not making it clearer: I want to be able to use the model to predict the growth of trees of a given size and competitive environment (fixed effects), and growing in specific treatments and/or plots (random effects). Although `predict` will allow me to do this, for lmer models it will not provide SE for the predictions. I am trying to find a way to incorporate the uncertainty in the model into my predictions so that I can make meaningful comparisons. – user2637462 Jul 31 '13 at 12:28
  • this is cross-posted to the r-sig-mixed-models@r-project.org mailing list http://news.gmane.org/gmane.comp.lang.r.lme4.devel . I will probably answer there. – Ben Bolker Jul 31 '13 at 12:54
  • Sorry for cross-posting. The message I sent to r-sig-mixed-models@r-project.org was not appearing correctly. Thanks for your help! – user2637462 Jul 31 '13 at 13:01

0 Answers0