[R-sig-ME] glmm on paired data with repeated measures
Mariano Devoto
mdevoto at agro.uba.ar
Fri Mar 3 15:51:23 CET 2017
Hi everyone. I'd really appreciate help with the following analysis.
Apologies for such a basic question; I looked for previous queries on
similar data, but none seem to quite fit what I am after.
I have a field experiment aimed at understanding how the presence of
"bodyguard" ants regulates the abundance of butterfly eggs and larvae (and
the damage the latter cause) on a focal plant species.
For this, I set up fourteen pairs of plants in a nature reserve and then
assigned each plant in each pair to one of two treatments, either "with
ants" or "without ants", by applying a physical barrier at the base of the
plant.
In the following nine weeks I measured four response variables once a week
on a subsample of ten randomly chosen leaves of each plant. I thus have
nine repeated measures on each plant.
My response variables are:
ants: number of ants (this was measured just to check the physical barrier
had worked OK)
eggs: number of butterfly eggs
larvae: number of butterfly larvae
dam: percent leaf damage (percentage eaten by larvae)
My explanatory variables are:
treat: treatment (two levels: "con" and "sin" mean with and without ants,
respectively)
pair: plant pair
date
For each response variable I would like to build a model that accounts for
the lack of independence of data within each pair, and that considers the
fact that data come from repeated measures (so, for instance, leaf damage
tends to accumulate).
My specific question is if including the random term "pair" in the model
accomplishes both things. I guess it probably doesn't, so I'd appreciate
any suggestions.
The results indicate plants without ants have a higher number of eggs
(which is what we expected, yeaeee), but without proper control of the
autocorrelations I mentioned I am not convinced.
I provide a workable example below.
#read data from Google drive
#each line represents the variables measured on a single leaf of a single
plant on a single date.
id <- "0Bzd8I1jr8z_iU0h6R0hxaElseDA" # google file ID
gaston <- read.table(sprintf("
https://docs.google.com/uc?id=%s&export=download", id), head=T)
#GLMM
require(lme4); require(effects)
M1 <- glmer(eggs ~ treat + (1|pair), data=gaston, family=poisson)
#check if there are any significant effects of treatment
summary(M1)
allEffects(M1)
Thanks in advance for your help.
Best,
Mariano
*Dr. Mariano Devoto*
Profesor Adjunto - Cátedra de Botánica General, Facultad de Agronomía de la
UBA
Investigador Adjunto del CONICET
Av. San Martín 4453 - C1417DSE - C. A. de Buenos Aires - Argentina
+5411 4524-8069
http://www.agro.uba.ar/users/mdevoto/
[[alternative HTML version deleted]]
More information about the R-sig-mixed-models
mailing list