I have to do a model for non-linear data with repeated measurements.
I worked with predatory insects. I did an experiment with 4 treatments, where per each treatment predators received a different diet during their nymphal development. When the predators reached the adult stage I assessed their predation rate in 2 days for every individual (in day 1 and day 5 after moulting respectively). The experiment had 2 replicates.
I am looking for a model in which I can see what had an impact on the predation rate (different diets(treatment), sex of the predator, etc.) and if there was a difference between the predation performance in day 1 and day 5.
First I used a generalized linear mixed model (glmer
) as follow:
glmer_eaten <- glmer(eaten~treatment*day+sex+(1|treatment:block),
family="poisson", data=ex1)
where the factors are: the correlation between treatment
and day
, the sex
of the predators, and as random effect treatment:block
. (the random effect is not block alone since there are only 2 blocks, therefore the statistician told me to use treatment:block).
However, the random effect is not significant therefore I am using a generalized linear model (glm
) instead.
glm(eaten~treatment*day+sex+block, family="poisson", data=ex1)
Nevertheless I do not know how to write in the model that there were REPEATED MEASUREMENTS. I mean I have to clarify that for the predation in day 1 and day 5 I used the same individual. Do you know how to write it the code?