On 06/04/16 20:12, Aislinn Pearson wrote:
Hi,
I've tried googling this but haven't been very successful. Essentially, I'd
like to know what is the most statistically valid way of dealing with a random
term which doesn't apply to every level of fixed-effect factor.
I have a mixed effect model that looks like this
Disease level <- weight + Flown +(1|DateFlown)
Either I flew my insects on a flight mill (which can be thought of as a 'treadmill'
for flying insects) or I didn't, hence flown is a two level factor (Yes or No) and
I want to understand how this affects the amount of disease in my insect. To get as
many replicates as I could on a single day, I had two different banks of flight
mills (A & B), each bank containing 16 individual insect treadmills. The
insects were randomly assigned to one of the two sets of 16 flight mills. Previous
studies tell me there are differences between these two sets of flight mills, so I
would like to account for them as a random term in my model.
As a practical matter, it's not worth setting a level with two levels as
random: you don't gain anything in the analysis and the variance
component is really poorly estimated. In practice, this might actually
make things cleaner, as you will have to look a bit more at the flight
mill effects, so you should get a better feel for what's happening.
However, I can't run this in LMER. When I tried I got the error;
Error in `contrasts<-`(`*tmp*`, value = contr.funs[1 + isOF[nn]]) :
contrasts can be applied only to factors with 2 or more levels
Which I imagine means that one of my factors (i.e. Flown) doesn't include any
levels for the random term mill set (i.e. for all unflown insects the value in
the mill set column is NA)
Is it possible to include this form of experimental design in LMER (the package
I know best) or, alternatively, nlme (which I am a lot less accustomed to
using)?
I can think of two ways of doing this: either set up a factor with three
levels (Flight mill A, Flight mill B, Not Flown) or set the Not Flown to
one of the flight mill levels. The first way feels less confusing, but
you might have to set up some contrasts to estimate the differences. But
hopefully your insects will cooperate nicely and make the difference
between the flight ills will be much smaller than between flight mills
and not flown.
HTH
Bob
I would be really grateful if anyone has any insight.
Many thanks
Rothamsted Research is a company limited by guarantee, registered in England at
Harpenden, Hertfordshire, AL5 2JQ under the registration number 2393175 and a
not for profit charity number 802038.
[[alternative HTML version deleted]]
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology
--
Bob O'Hara
Biodiversity and Climate Research Centre
Senckenberganlage 25
D-60325 Frankfurt am Main,
Germany
Tel: +49 69 7542 1863
Mobile: +49 1515 888 5440
WWW: http://www.bik-f.de/root/index.php?page_id=219
Blog: http://blogs.nature.com/boboh
Journal of Negative Results - EEB: www.jnr-eeb.org
_______________________________________________
R-sig-ecology mailing list
R-sig-ecology@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-ecology