how to model data with repeated measures but a low number of random-effect levels I want to model the productivity of a beech forest in relation to satellite-based indices of photosynthetic activity and meteorological variables. I have data for five years on the number of seeds collected in 30 plots of one square meter. The plots are distributed in three sampling areas: 10 plots per location. My predictor variables are repeated in the 10 plots within each sampling area. I know that is advised to have >5–6 random-effect levels per random effect in order to build a mixed model. So in my case running a mixed model does not seem adequate. An alternative approach can be to average away the pseudoreplication within each sampling area and carry out my statistical analysis on the means. Yet, I am afraid that the averaged values may not be independent between sampling areas because most variables (dependent and independent) are synchronized (e.g., the temperature does not vary much from one valley to the next one)
What type of analysis should I run? Is my sample size too little to run any statistical analysis?
Thank you very much!
PS: please find below the structure of my data frame
'data.frame':   150 obs. of  8 variables:
 $ sampling_site: Factor w/ 3 levels "A","B","C": 1 1 1 1 1 1 1 1 1 1 ...
 $ year         : Factor w/ 5 levels "2013","2014",..: 1 1 1 1 1 1 1 1 1 1 ...
 $ plot         : Factor w/ 30 levels "1","2","3","4",..: 1 2 3 4 5 6 7 8 9 10 ...
 $ Ncounts      : int  2 2 2 2 2 2 2 2 2 2 ...
 $ Nseeds_sum   : int  286 139 66 129 68 109 101 230 32 NA ...
 $ temp         : num  4.2 4.2 4.2 4.2 4.2 4.2 4.2 4.2 4.2 4.2 ...
 $ prep         : num  14.4 14.4 14.4 14.4 14.4 14.4 14.4 14.4 14.4 14.4 ...
 $ evi          : num  0.161 0.161 0.161 0.161 0.161 ...

 A: Thanks for posting your data, Carlos. Please bear in mind that I am not an ecologist, so I cannot speak to whether what I propose makes sense in your field. However, given your data, I would suggest you consider a two-level (mixed effects) model, with the 5 yearly observations nested within 30 plots. I would treat sampling site as a fixed factor with three levels because, as you suspect, there are not enough levels to treat it as a random factor, unless you are comfortable going with a Bayesian approach. In lmer:
m1 <- lmer(outcome ~ 1 + predictors + sampling_site + (1|plot), data=df)
One element that you should carefully consider is how to treat year. Do you expect there to be any sort of systematic linear or otherwise trend in your outcome as a function of time (year). And would that effect vary across your plots? If yes, then you might consider a so-called growth curve model:
m2 <- lmer(outcome ~ 1 + predictors + year + sampling_site + (year|plot), data=df)
This allows for an average linear effect of year (the fixed predictor) and then allows for variation in this linear trend for each plot (the random slope for year). If this doesn't seem reasonable, then you can account for year as a set of fixed predictors that have the effect of estimating the associations between predictors and outcome within years:
m3 <- lmer(outcome ~ 1 + predictors + as.factor(year) + sampling_site + (1|plot), data=df)
