# Can I use location as a random effect when treatment levels are not exactly the same across those locations?

I am working on a data set that aims to test various treatments with respect to vegetation regeneration. The experiment is replicated at many sites across a large geographical gradient and has been measured over multiple years.

So far so good. Normally I would go ahead and use a (generalized) linear-mixed model approach in which I would set Year and Location as random effects and treatment as fixed effect. However there is one twist and that is that one treatment level in the experiment consists of testing plant seed mixes which are native to the individual location (location being the random effect in my model). So the locations do not share the same seed mixes for that specific treatment level. Or in other words that particular treatment level is not the same across locations but instead was adjusted for the given regions.

Is this "not the same across locations" a problem when using Location as a random effect in my model? I have been scratching my head now for a while.

My question is:

Is it reasonable to use Location as a random effect and only run a single model and being able to say whether seed mix is significantly different from the other treatments in general - or should I subset the data by Location and run separate models on each location instead and interpret the results on a location by location basis?

The problem with the individual approach is that it would cut down the number of samples per treatment level.

• I don't see an issue. Take a simple example: Someone wearing a custom-made suit will generally look better than if he wears a ready-made suit (fixed effect). How much better depends on the person (random effect). Your locations have still specific traits that impact how native seeds grow, in fact, the native seeds are part of those traits. Your treatment "using native seeds" is still the same over all locations. – Roland Dec 5 '19 at 7:39
• You should use location as a random effect AND allow, not just the intercept, but also the effect of the treatment to vary by location. This is because there is no reason to believe the treatment is equally effective across locations given that the treatments are different. – Heteroskedastic Jim Dec 11 '19 at 21:10
• @HeteroskedasticJim Yes I already tried but then I ran into convergence issues. Plus I have binomial, beta and gamma models to run due to the nature of the outcome variables using glmer and glmmTMB. Sticking with the simpler random intercept models allows me to do the model fitting without any trouble. But yes in general I definitely agree with your point. – Stefan Dec 12 '19 at 0:52
• @Stefan what were the convergence issues? Was it a variance running to zero issue? Or coefficients blowing up issue? If you think it's worth fitting a flexible model, something like brms may be worth trying. Best of luck. – Heteroskedastic Jim Dec 12 '19 at 1:15
• @HeteroskedasticJim it's non-positive-definite Hessian matrix issues and Model convergence problem; false convergence (8) problems. Simple matter of fact is that this data set doesn't have enough samples to carry out random intercept/slope models for the given distributions. Also I have many zeros in my continuous proportions so I am fitting a binomial model first and then on the non-zeros the beta model. I looked at brms too but that is a project for some other time. Bayesian models are definitely the way to go for those zero altered beta models. Thanks for the input though! – Stefan Dec 12 '19 at 1:41

Since you have multiple measurements per Location, there is likely to be correlation of measures within each Location and since you are not interested in any fixed effects of of Location, this is naturally handled by fitting random intercepts for it.