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:
no.of.eventequal to the total cumulative number of all events observed?
time.in.yearsbe 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?
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?
Is the following R script right?
model <- glm(no.of.event ~1, offset(time.in.years), family="poisson", data=data)
Should incidence (cases per 1000 person years) be calculated by this?
And the 95% confidence interval be like this?
exp(model$coef + 1.96*sqrt(diag(vcov(model)))) exp(model$coef - 1.96*sqrt(diag(vcov(model))))
If I want to calculate specific incidence, say among males and females and I have a column in the data frame called
sexwith 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, ])