The following example does not require the use of any specific R library, we will do simply “by hand” calculations.
Age-specific data on the incidence of colon cancer in male and female populations of Finland during 1999 are given in the following table:
Let’s calculate the following summary measures:
We will compare and comment the results obtained in items 1 to 3.
World Standard Population:
First of all, we create the data matrix:
M <- matrix( c(10,1157,46.0,0.9,22,1109,41.9,2.0,0.44
,76,809,32.0,9.4,68,786,29.7,8.6,1.09
,305,455,18.0,67,288,524,19.8,55,1.22
,201,102,4.0,196,354,229,8.6,155,1.27), nrow=4, byrow=T )
M <- data.frame(M)
names(M) <- c("mca","mpy","mp","mr",
"fca","fpy","fp","fr","rr")
M
## mca mpy mp mr fca fpy fp fr rr
## 1 10 1157 46 0.9 22 1109 41.9 2.0 0.44
## 2 76 809 32 9.4 68 786 29.7 8.6 1.09
## 3 305 455 18 67.0 288 524 19.8 55.0 1.22
## 4 201 102 4 196.0 354 229 8.6 155.0 1.27
Then, we compute the crude incidence rates:
rates <- with( M, c( sum(mca)/sum(mpy)*100,
sum(fca)/sum(fpy)*100 ) )
rates[3] <- rates[1]/rates[2]
names(rates) <- c("M rate","F rate","M/F RR")
round( rates, 2 )
## M rate F rate M/F RR
## 23.46 27.64 0.85
Now we compute the age-standardized rates and their ratio using the male population as the standard:
wm <- with( M, mpy/sum(mpy) )
wm
## [1] 0.45858105 0.32065002 0.18034086 0.04042806
rates <-with( M, c( sum(mca/mpy*wm)*100,
sum(fca/fpy*wm)*100 ) )
rates[3] <- rates[1]/rates[2]
names(rates) <- c("M rate","F rate","M/F RR")
round( rates, 2 )
## M rate F rate M/F RR
## 23.46 19.85 1.18
And now we compute the age-standardized rates and their ratio using the World Standard Population:
WSP <- c(120,100,90,90,80,80,60,60,60,60,50,40,40,30,20,10,5,3,2)
WSP
## [1] 120 100 90 90 80 80 60 60 60 60 50 40 40 30 20 10 5 3 2
wt <- sum(WSP[1:7])
wt[2] <- sum(WSP[8:11])
wt[3] <- sum(WSP[12:15])
wt[4] <- sum(WSP[16:19])
wt <- wt/sum(wt)
wt
## [1] 0.62 0.23 0.13 0.02
rates <- with( M, c( sum(mca/mpy*wt)*100,
sum(fca/fpy*wt)*100 ) )
rates[3] <- rates[1]/rates[2]
names(rates) <- c("M rate","F rate","M/F RR")
round( rates, 2 )
## M rate F rate M/F RR
## 15.35 13.46 1.14
We can notice that when using the original data from the Finland population, males seem to have a low risk of colon cancer with respect to females. But this result is driven by the confounding effect of age, since females are older than males. When comparing the rates adjusting for the differences in age groups, the relative risk of males is instead higher than females.
If you want to see other examples using specific R libraries check the following website: https://epirhandbook.com/en/standardised-rates.html