I have built a series of glmm's to explore how habitat characteristics impact the abundance of the organism I study. I've trained these models on data from a given set of time (2 year span) and would like to test the model predictions from a different set of data from a different set of time (3 year span, non-overlapping years). The datasets are ~ 7 years apart, but within the exact same spatial extent (some even at the same sites).

An example model I have built would be something like:

model <- glmer(abundance ~ scale(var1) + scale(var2) ... + scale(year) + (1 | site), 
               data = dataset1, family = poisson())

This model is then trained, and I am interested in using the model with a new data set (dataset2) to predict the abundance. However, because the effect of year is large (i.e., organism abundance varies greatly from year to year), the model prediction on the new data is extremely misleading (off by several orders of magnitude).

What is the best way to move forward in testing the accuracy of my model? A couple of ideas I had but would love feedback on:

  1. Combine datasets together and randomly draw 70/30 training/testing data, still treating year as a fixed effect. This way, all of the years should be present in the training and testing model.

  2. Treat year as a random effect in addition to site.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.