title: lme4 random effect structure with dredge
body: <p>I have constructed an <code>lme4</code> model for model selection in <code>dredge</code> but I am having trouble aligning the random effects with the relevant fixed effects.The structure of my full model is as follows.</p>
  
  <pre><code>fullModel&lt;-glmer(y ~x1 + x2 + (0+x1|Year) + (0+x1|Country) + (0+x2|Year) + (0+x2|Country) + (1 | Year) +(1|Country), family=binomial('logit'),data = alldata)
  </code></pre>
  
  <p>In this model structure, model selection in <code>dredge</code> produces three combinations of fixed effects, i.e. x1, x2, and x1+x2, however the random effect structure remains the same as in the full model, such that even when fixed effect is only x1, the random effect will include <code>(0+x2|Year) + (0+x2|Country)</code>. For example the model with only x1 as the fixed effect, will still have x2 within the random effects structure as follows.</p>
  
  <pre><code>y ~x1 + (0+x1|Year) + (0+x1|Country) + (0+x2|Year) +(0+x2|Country) + (1 | Year) +(1|Country), family=binomial('logit')
  </code></pre>
  
  <p>Is there a way to configure <code>dredge</code> not to select random effects that have other fixed effects specified in them? I have about x1….x50.</p>