[R-sig-ME] fixed or random effects?

Douglas Bates bates at stat.wisc.edu
Mon Oct 1 21:03:27 CEST 2012


On Mon, Oct 1, 2012 at 1:10 PM, joana martelo <jmmartelo at fc.ul.pt> wrote:

> I'm modeling fish activity data with a gaussian distribution for scores
> obtained from Principal Component Analysis, and have a little problem,
> hopefully simple to resolve. My explanatory variables are group size, fish
> length and temperature and I sampled in two consecutive years, in spring. My
> problem is that I'm not sure whether I should consider year as a random or a
> fixed effect. I wonder if you could help me.

For you the year factor will have only two levels and that is too few
to model the effect of year as a random effect.  When you incorporate
a random-effects term in a model you end up estimating a variance
component instead of trying to estimate coefficients in a linear model
expression directly.  Having only two levels of year will not allow
for a precise estimate of a variance component.  In fact, it will be a
horribly imprecise estimate.

There are no hard and fast rules of how many levels are required to be
able to estimate a variance component but fewer than 5 is too few and
more than 10 is adequate.  I have used as few as 6 levels but that was
on nicely balanced data from a designed experiment.  Observational
data that is highly unbalanced requires more care.



More information about the R-sig-mixed-models mailing list