[R-sig-ME] Advice on repeated-measures mixed model (lmer)

André Pardal @ndre@p@rd@|@@ouz@ @end|ng |rom gm@||@com
Thu Oct 31 18:39:23 CET 2019


Hey everyone,

I am wondering if someone could advice me on a repeated-measure mixed model
analysis.

So, I carried out an experiment of effect of contamination by antifouling
paint on predator-prey interaction (snails and barnacles).

I have the repeated-measures of number of barnacles consume through time in
different treatments (AP and control) in each replicate (cages). See
structure of my dataframe below. (Everything is balanced.)

> str(consumption)
'data.frame': 96 obs. of  9 variables:
 $ tr            : Factor w/ 2 levels "antifouling paint",..: 1 1 1 1 1 1 1
1 1 1 ...
 $ replicate  : Factor w/ 16 levels "AP1","AP2","AP3",..: 1 2 3 4 5 6 7 8 1
2 ...
 $ time        : int  0 0 0 0 0 0 0 0 27 27 ...
 $ cons        : int  0 0 0 0 0 0 0 0 19 37 ...
 $ cons_pc   : num  0 0 0 0 0 ...

1) My first doubt is about day 0. In day 0 there is no consumption, so I
have a lot of zeros what is giving me trouble to meet a normal
distribution. My doubt here is if I should/could (or not) to remove day 0
from analysis. I did some tests and removed day 0, and I got far better
normal distribution.

2) I am running the following mixed-model, but I am not sure if it is
right. As consumption is 0 in day 0, I am running a mixed-model with
varying slope only. Also, what I want is set a model in each the slope
varies randomly per replicate through time. That's what I am running:

*m1 = lmer(cons_pc ~ tr*time + (time-1|replicate), data= consumption)*

Alternatively, I could have:

*m2 = lmer(cons_pc ~ tr*time + (1+time|replicate), data= consumption)*#
intercept and slope varying per replicate
*m3 = lmer(cons_pc ~ tr*time + (1|replicate), data= consumption)* #
intercept only varying per replicate

I think the first model is the right one, but I am not sure. Anyone could
confirm?

I ran all of them as a test and all of them work, and the first one is the
best one (according to AIC score and LR-test).

Thanks very much in advance.

My best,

Andre.
-- 

Visiting PhD student
School of Ocean Sciences
Bangor University
Menai Bridge, Anglesey, UK

	[[alternative HTML version deleted]]



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