Hello,

I am analyzing a dataset where the response is count data.  I have one
two-level factor that is repeated within-subjects and additional
between-subject variables that are either categorical or continuous.  I have
previously modeled a comparable dataset (without the within-subjects factor)
using glm with family=poisson, but see no way to incorporate repeated
measures with the glm function.

Here is a small dataset that illustrates the data structure, note that each
subject is repeated twice, once for each level of factor "X1":

dframe <-
data.frame(response=rpois(1:10,2),subjects=sort(rep(c("Tom","Nic","Bil","Jon","Jil"),2)),X1=rep(c("A","B"),5),X2=rep(sapply(1:5,function(x)
rnorm(1)),each=2))


Can someone suggest an approach to test for an effect of "X1" and "X2" on
"counts"?

Best,

Jonathan

	[[alternative HTML version deleted]]

