I am trying to analyze a dataset where I have individuals from 3 different species (essentially 3 'treatments'), and I score each individual on a cognitive test once per day, for 10 days. Essentially, I am interested in knowing if there are significant differences between species (treatments) in their ability to learn this cognitive task. 'Score' is my response variable, and consists of counts, so I'm thinking this represents a Poisson distribution. I am confused about how to incorporate the fact that 'Day' is a repeated measure within individuals, while 'Species' is a between-individual factor with 3 levels. I'm also unsure whether any of my variables are nested, and if I need to incorporate that into my syntax. I think I need to use the 'glmer' function in R, from the 'lme4' package. So far, I've come up with this:
m1<-glmer(Score~Species*Day + (1|Subject), family = poisson, data=myData)
As far as I can tell, this model considers 'Treatment' and 'Day' as fixed effects, as well as the interaction between them. The model also considers 'Subject' as a random effect (which is what I think the '1|x' notation does). However, I don't think this accounts for any nesting of the data, and again, I'm not sure if that is important here. Also, I'm not sure if 'Day' also needs to be incorporated as a random effect.
I also have sex information about all of my subjects, and I would potentially be interested in knowing if there are sex differences in the performance on the cognitive task, although this is not my primary focus. I assume sex could also be considered as a random effect?
Any and all criticisms welcome!