Is it correct to evaluate differences of a binary variable between different places with a GLMM? I am analyzing differences of a binary variable (presence / absence) between 3 wetlands with different pollution using a Generalized Linear Mixed-Effects Models with package lme of software R.
My model in software R is:
glmer (data $ binary ~ data $ wetland + data $ predictive1 + data $ predictive2 + data $ predictive3 + (1 | data $ date), data = data, family = binomial ())

My queries:

*

*Is it correct to treat the date as a random effect?

*Should you also consider wetlands as another random effect?

*Should I include interaction between wetland and date? (my model has a nested design)

It should be noted that for all predictive variables there is statistical significance, there is also no autocorrelation between the variables, and the GVIF is correct.
 A: A couple of points:

*

*Mixed models are used to account for correlations in the levels of grouping factor. If you are going to put date as a grouping factor, then you assume that binary measurements on the same date from different wetlands are correlated. To answer if this is a reasonable assumption, requires subject-matter expertise, but I would say that perhaps measurement taken in the same wetland are expected to be more correlated than measurements from different wetlands.

*If you are going to treat wetlands as a grouping factor, then the specification of the random-effects part will specify the correlation structure. Assuming random-intercepts (i.e., including the term (1 | wetland)) would postulate the correlations are constant over time. If you also include a random slope (i.e., (date | wetland)), then you would assume that measurements from the same wetland that are closer in time are more correlated than measurements further in time.

*If you use wetland as a grouping factor, then you should not also include it as a fixed effect.

*Finally, if you use the data argument of glmer(), you do not need to the data$ inside the formula, i.e., it should be sufficient to use:

glmer(binary ~ date + predictive1 + predictive2 
               + predictive3 + (1 | wetland), data = data, 
      family = binomial())

