My understanding of a random effect is based on this paper, specifically this definition:
Random effects: factors whose levels are sampled from a larger population, or whose interest lies in the variation among them rather than the specific effects of each level. (Bolker et al., 2009)
In ecology random effects seem to be mostly used to avoid (psuedo-)replication from repeated measures, for example sampling from the same location repeatedly, or to account for phylogeny i.e. that closely related species are more likely to be similar due to shared evolutionary history.
This seems to me to be only a restricted application of a random effect, based on the above definition. The Bolker definition says to me that treating a sampling unit as a random effect will control for unmeasured differences between sampling units that may affect the variables I’m interested in. Is this correct?
Say I have a study where I’m interested in measuring X
. My sampling design involves paired
sampling at a number of different locations
(not repeated), on different dates
. Pairs
would be random effects, to avoid repeated measures as discussed above. What about location
and date
? I’m not interested in the differences between locations
or date
, only X
. In fact, I’d like to control for the differences between location
and date
to get a better understanding of the effect of X
on my response. Would treating location
and date
as random effects accomplish this? I.e.:
Response ~ X + (1|location/pair) + (1|date)
But why not treat location
and date
as fixed variables?
Response ~ X + location + date + (1|pair)
This will still seperate the effect of location
and date
from the effect of X
, so why have them as random variables? If I have them as fixed effects I'll be able to measure the effect they're having on X
, so why use random effects?
While the answers from @Royce Yang and @Guille were helpful to get me thinking along the right lines, the best explanation I've found (and should have found before posting this question, not sure how I missed it) is here (thanks @mkt for the link) and leading on from that, the post here. I think my question was the problem - I should have phrased it more broadly.