Hi All,

I am fitting a Gaussian lmer model to a set of training data with a number of fixed effects and 'year' as a random effect.

I want to use the model that I have fit to the training data (which spans the period 1982 - 2001) to predict to another data set which covers the period 2001 - 2011.  I am doing this as a form of external model validation (how good is my model at predicted to a different dataset that does not span the same temporal extent as the training data?).  However I am getting an error message: "Error in (function (x, n)  : new levels detected in newdata".  This has caused me to question whether it is even possible to use an lmer model to predict to data with values outside the range of the random effect in the training data?  I assume this must be possible, because many studies have used mixed effects models to predict into the future........

I have checked that the levels of all the fixed effect factors are the same between the two datasets (training and validation).  Additionally I have tried specifying the random effect (year) as.numeric and as.integer as opposed to as.factor (in order to work out of this was a factor-specific problem), but this has made no difference.

Any advice on this would be much appreciated.
Thanks,
Alice


Dr Alice Jones
ARC Research Associate
Global Ecology Lab &
School of Earth and Environmental Sciences

G44, Mawson Laboratory,
North Terrace Campus,
The University of Adelaide,
Australia 5005

alice.jones01@adelaide.edu.au<mailto:alice.jones01@adelaide.edu.au>
Web profile<http://www.adelaide.edu.au/directory/alice.jones01>
Ph:  +61 8 8313 2243


	[[alternative HTML version deleted]]

