I ran a BACI experiment looking at the effect of artificial light at night on fish reproduction, and one of our response variable is the yolk area in their eggs. My raw data looks like the attached picture. enter image description here
I ran lmer models on the log-transformed data (i.e. yolk area) and I found that the best fit model needs to have the interaction term Treatment*Period as I expected from the graph (i.e. difference in Before and After is different regarding treatments). I then used emmeans to compute the contrasts of the model and here is what I get (back transformed data):
contrast estimate SE df t.ratio p.value
CTRL Before - ALAN Before -0.01017 0.01938 18.8 -0.525 0.9944
CTRL Before - NAIVE Before 0.01143 0.01984 19.9 0.576 0.9915
CTRL Before - CTRL After 0.02917 0.00749 19.9 3.896 0.0101
CTRL Before - ALAN After 0.04443 0.01768 19.9 2.513 0.1673
CTRL Before - NAIVE After 0.05221 0.01825 19.9 2.861 0.0879
ALAN Before - NAIVE Before 0.02161 0.02033 18.8 1.063 0.8897
ALAN Before - CTRL After 0.03935 0.01849 18.8 2.129 0.3153
ALAN Before - ALAN After 0.05460 0.00785 18.8 6.958 <.0001
ALAN Before - NAIVE After 0.06238 0.01871 18.8 3.335 0.0354
NAIVE Before - CTRL After 0.01774 0.01892 20.6 0.937 0.9320
NAIVE Before - ALAN After 0.03299 0.01867 20.6 1.768 0.5063
NAIVE Before - NAIVE After 0.04078 0.00834 20.6 4.890 0.0010
CTRL After - ALAN After 0.01525 0.01661 22.1 0.918 0.9376
CTRL After - NAIVE After 0.02304 0.01724 21.6 1.336 0.7623
ALAN After - NAIVE After 0.00778 0.01690 21.6 0.461 0.9970
Obviously, I have temporal variation because of the significant difference between my Before and After CTRL. However, the differences in Before and After ALAN and NAIVE are greater, suggesting I have temporal variation AND an effect of my treatments. My question is the following: Do you know a way to account for the temporal variability measured by the CTRL treatment in order to subtract it from the differences in the two other treatments so that I can measure only the effect of the treatment?
I think you are looking for comparisons of comparisons. If so, try something like this:
This gives us BEFORE - AFTER comparisons for each treatment. Now do:
This removes
Treatment
as aby
variable and compares each estimate indiffs
with the first on, which I think is CTRL.