Hi Kate,

It's a little difficult to know your data structure from your description,
it's always helpful to include a sample of the data, or a dummy data set
with the same structure.

>lmer(y~Treatment+Habitat+(1|Site)+(1|Treatment)+(1|Period)+(1|Time), data)

Your Treatment variable presumably has only 2 levels, treated and untreated?
It's not a good idea to include random effects with fewer that 4-5 levels
because the model will be attempting to estimate the variance across those
levels. In any case, Treatment is in no way "random" here.

Likewise, Time and Period both have just 2 levels right?

Period represents before and after treatment? And Time is the two seasons in
which you measured whatever you measured?

And at each Site you have 2 Habitats?

And your 34 Sites are paired with 1 Site in each pair treated?


It sounds like you have a kind of before-and-after-control-impact-pair setup
BACIP.

You probably want to add a variable, Pair, assuming that your Sites were
really pairs in a meaningful way (like close together in space relative to
the other pairs).


Therefore you're interested in how y varies between Period 1 and 2 (before
and after), and how Treatment interacts with this, and how the treatment
interaction varies by habitat.

Your full model would be something like this:

lmer(y~Period*Treatment*Habitat+Time+(1|Site), data)

or perhaps this:

lmer(y~Period*Treatment*Habitat+Time+(1|Pair), data)



Andy.




andydolman@gmail.com


2009/6/3 CL Pressland <Kate.Pressland@bristol.ac.uk>

Dear mixed modellers,
>
> just want some opinions from those willing to share them - I have a design
> and wonder if mixed models could analyse it.
>
> *I have 34 sites that are split into pairs of sites that do or do not
> receive a treatment. This means I have n=17 as the pairs are obviously not
> independent of each other.
> *I surveyed information from them also _before_ and _after_ treatment was
> applied so each pair/site is also paired over time due to the repeat
> measurement. *With each survey 2 repeat measurements were taken
> simultaneously over 2 habitats.
>
> I was wondering if this is a reasonable design to tackle with mixed models?
> I have researching matched pairs designs but they fail as there is the
> double pairing non-independence issue. I am interested in whether or not
> treatment affects y, and not how site A at time 1 is different to site A at
> time 2 - there is a seasonal issue so I know it will be different. Treatment
> is my key question, and if the 2 habitats are affected differently. My
> limited knowledge of mixed models tells me it is doable but I want to check
> with people that really know what they're talking about!
>
> If in theory mixed models are suitable, would a design like this be
> appropriate or will it need to be a little more complex that this super
> simple model?
> lmer(y~Treatment+Habitat+(1|Site)+(1|Treatment)+(1|Period)+(1|Time), data)
>
> Any hints you could give me would be gratefully received.
>
> Kate
>
> -----------------------------------
> Ph.D student and mixed model beginner
>
> _______________________________________________
> R-sig-mixed-models@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>

	[[alternative HTML version deleted]]


