There is a very nice paper that illustrates a flexible approach that allows the user to specify nearly any possible prediction he or she may desire. A flexible system is critical since "one man's fixed effect is another man's random effect" to quote Schabenberger.
@article{welham2004prediction, title={{Prediction in linear mixed models}}, author={Welham, S. and Cullis, B. and Gogel, B. and Gilmour, A. and Thompson, R.}, journal={Australian \& New Zealand Journal of Statistics}, volume={46}, number={3}, pages={325--347}, year={2004}, publisher={John Wiley \& Sons} } Kevin Wright On Tue, Mar 23, 2010 at 8:15 PM, Ben Bolker <bol...@ufl.edu> wrote: > Douglas Bates <bates <at> stat.wisc.edu> writes: > > > It is not easy to decide what "predict" should return for a linear > > mixed model, let alone the more complicated cases. Do you want > > predictions based on the fixed-effects only or based on a combination > > of the fixed-effects and the random-effects? For the lme function in > > the nlme package we allowed "levels" of predictions but that won't > > work for all models that can be fit with lme4. > > I do actually think there's a reasonable way to specify this -- > an indicator specifying which random effects should have their > conditional modes included in the prediction (the default could > be either 'none' or 'all'). > > Further discussion should presumably move to r-sig-mixed-models. > > > > On Tue, Mar 23, 2010 at 9:18 AM, Markus Loecher wrote: > > > Dear mixed effects modelers, > > > I seem unable to find a predict method for mer objects in the package > lme4. > > > Am I not seeing the forest for the trees ? > > In the meantime you can construct your own model matrices > and use them to generate the predictions by hand -- see > > http://glmm.wikidot.com/local--files/examples/Owls.pdf > http://glmm.wikidot.com/local--files/examples/Owls.Rnw > > for a bit of a worked example. > > Ben Bolker > > ______________________________________________ > R-help@r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code. > [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.