# Poisson regression in R glm(): concept and practice [closed]

I have a dataset data about a group of persons developing events with Poisson distribution. These events are uniform and can be recurrent in some of the subjects. Their observation time is different. I tried to use R to calculate the incidence rate (in 1000 person years) of the event in the whole group and specific subgroups (e.g. male and female).

no.of.event is the total number of observed events and time.in.years is the total observation time in years.

As I do not understand Poisson regression well, I would like to ask:

1. If no.of.event equal to the total cumulative number of all events observed?

2. And time.in.years be the time from the start of observation till study end/ default or death? Or be the time from the start of observation till the development of event of interest?

3. In those persons with recurrent events what would be time.in.years? Say if someone has developed 3 events and did not default, is the time counted from the start of observation till the development of third events? Or from the start till the end of observation?

4. Is the following R script right?

model <- glm(no.of.event ~1, offset(time.in.years), family="poisson", data=data)

5. Should incidence (cases per 1000 person years) be calculated by this?

exp(model$coef[1])*1000  6. And the 95% confidence interval be like this? exp(model$coef[1] + 1.96*sqrt(diag(vcov(model)))[1])
exp(model$coef[1] - 1.96*sqrt(diag(vcov(model)))[1])  7. If I want to calculate specific incidence, say among males and females and I have a column in the data frame called sex with 1 coded for males, should I write something like this? model <- glm(no.of.event~1, offset(time.in.years), family="poisson", data=data[data$sex==1, ])


## closed as too broad by kjetil b halvorsen, whuber♦Mar 31 at 21:21

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.