The data and model used so far:
I have longitudinal count data on 16 pens (8 with treatment A, 8 with treatment B). Each pen houses the same number of animals, and the pens may be considered as independent. On each day (from 1 to 27), a number of diarrhea-related events was counted for each pen. The resulting counts are between 0 and 8, with roughly 45% 0 values and most values below 4.
Some "streaks" (or runs) of zero values (i.e. the counts stay zero for several days in a row) are present in the data. Overall, roughly 60% of the zero values are followed by another zero value on the next day (in both treatment groups).
I did not yet test whether the length and number of streaks is more than expected by chance, but it seems so. (I am not sure how to test this, and I may be wrong with my assessment.)
It is the main aim to characterize the average number of events per day, given the treatment. To do this properly, I also want to account for the temporal autocorrelation (which is present in the data) and to include something like a random intercept for each pen to reflect the possibly different initial health status of the animals in each pen.
I fitted a generalized additive mixed model (GAMM) using the mgcv package in R (Poisson response). I used a smoother (for each treatment group) to model the temporal trend, added a random intercept for each pen and included the residual autocorrelation with an AR(1) approach.
The model is acceptable, shows clear temporal trends which are different for the two groups, modestly different random intercepts per pen and some autocorrelation.
The question: Is there any way to explicitly add to the present model the "streaks" of zero values? I am aware that this is implicitly included in the autocorrelation in the GAMM model above, but it would be really nice to assess whether zero is a special "state". In a sense, I want to know whether the autocorrelation is particularly strong for the zero values.
I thought that maybe one could use a Markov chain approach (if needed, by categorizing the state space e.g. into "0", "1-2", and "3+" so that not too many transition probabilities have to be estimated), but I was not sure how to incorporate the fact that there is a clear temporal trend (and not sure whether and how an inhomogeneous Markov chain approach would make sense).
Any pointer would be greatly appreciated, also to something which would work if I had a larger sample (more pens). I will be happy to add any required clarifications, but I can not share the data at this point.