I have a couple related questions about using a generalize linear mixed effects model to analyze data from an agricultural field experiment. I have found several posts that are similar to this question, but nothing that quite gets at my points of confusion.
The experiment involved 4 treatments replicated 4 times each: one treatment per field plot, for a total of 16 field plots.
On multiple dates (12) throughout the season I measured a response (counts) and a few covariates at all 16 plots. Within each plot on each date I would make multiple measurements of my response and covariates. So, measurements within a plot on a given date are non-independent (spatial pseudoreplication), and measurements through time for each plot are non-independent (temporal pseudoreplication). OK, so a linear mixed model seems appropriate.
My response data roughly fit a negative binomial distribution. OK, so a generalized linear mixed model seems appropriate.
I want to account for the variation that occurs within a plot and also the variation that occurs on different dates.
Would it be valid for me to model it this way (treating date as a factor)?
#fake data; each plot is sampled at 4 locations on 12 different dates response=rnbinom(768,size=0.5,mu=2) treatment=factor(rep(c("one","two","three","four"),times=192)) covariate=rnbinom(768,size=.01,mu=4) date=factor(rep(1:12,each=64)) plotID=factor(rep(c("P1","P2","P3","P4","P5","P6","P7","P8","P9","P10","P11", "P12","P13","P14","P15","P16"),each=4,times=12)) #a model with random effects on the intercept library(glmmADMB) model1=glmmadmb(response~covariate+treatment+(1|date\plotID),family="nbinom2")
My concern is that, while plots are independent and randomly distributed, the dates are not. That is, I expect that on a given date the variance structure within a plot will be similar, but not between plots; however, I expect the variance structure to be similar across plots on a given date. Does this create problems for how I modeled the data above?
Am I even correct in thinking that the model would account for the variance that occurs on each date
(1|date) and the variation that occurs within each plot on a given date
I could model date as a continuous fixed effect, but for reasons I won't go into I'd prefer not to do that. Regardless, I have no interest in the effects of time on my response, other than as a source of variation that I'd like to account for.
I hope my thinking about this whole thing doesn't reveal any TOO glaring gaps in understanding :)
Thanks in advance for the help, oh wise internet community!!