Most texts I have read about Poisson-regression assumes that the data is available in an already grouped form, i.e. counts are given for each unique covariate combination. For instance, we have (in R)
DataGrouped<-data.frame(Gender=as.factor(c("M","F")),Counts=c(6,2)) DataGrouped Gender Counts 1 M 6 2 F 2
thus we can use
to run the Poisson-regression.
However, often we have individual-level data, such as
DataIndividual<-data.frame(PatientID=1:8,Gender=as.factor(c(rep("M",6),rep("F",2)))) DataIndividual PatientID Gender 1 1 M 2 2 M 3 3 M 4 4 M 5 5 M 6 6 M 7 7 F 8 8 F
which is clearly identical to the above database.
The question is: how can I run the Poisson-regression on such individual-level database?
Of course, I am aware that I could simply do the counting myself, for example with
but I am interested in whether it is possible without an explicit, manual counting. Especially, whether it is possible to somehow interface
DataIndividual directly to