3

I have a rate between the years 2005 and 2016:

years <- c(2005:2016)

count <- c(20535, 20526, 19694, 18452, 17402, 16551, 15679, 14691, 13409, 13378, 12772, 12417) #cases

pop<- c(68435380, 69295253, 70158111, 71051678, 72039206, 73142150, 74223628, 75175826, 76147624, 77181884, 78218478, 79277962) #population

Fitting the crude rate to GLM Poisson is:

glm(count~years+offset(log(pop)), family=poisson)

It is OK for me but how about calculating age-adjusted rate and then to fit GLM Poisson in R? My variables of the same data:

years <- c(2005:2016)

agecat <- c("0-4", "5-14", "15-24", "25-34", "35-44", "45-54", "55-64", "65+")

weight <- c(5, 11, 11.5, 12.5, 14, 14, 12.5, 19.5) #european standart population 

countcat_2005 <- c(293, 942, 4962, 4461, 3201, 2831, 1886, 1959) #age-categorized count of the cases in 2005

popcat_2005 <- c(5979662, 12665031, 12679110, 11546527, 9426447, 7104654, 4432038, 4601908) #age-categorized population in 2005

Age-categorized counts and population of the other years could also be provided.

double-beep
  • 5,031
  • 17
  • 33
  • 41

0 Answers0