I’ve been working on creating graphs for my final project of the year which is about a statistical and economic analysis of the Tunisian economy. Therefore, we cannot proceed on analyzing the Tunisian economy without taking into consideration the social demographic data which was the main topic of this project. So here I want to briefly share some interested graphs and to analyze them by showing how the Tunisian population was distributed. I’m writing in greater detail how to create population pyramids in R. You can’t make a population pyramid without data that are provided from the Tunisian National Institute of Statistics. The graphs are obtained by using the package plotrix.
library(plotrix)
x<-c(5.66,6.13,6.03,5.45,4.69,4.14,3.71,3.21,2.5,1.71,1.51,1.52,1.45,1.04,0.79,0.48,0.17)
y<-c(5.37,5.88,5.74,5.24,4.62,4.33,3.76,3.16,2.48,1.79,1.56,1.52,1.41,0.94,0.77,0.39,0.1)
agelabels<-c("0-5","5-10","10-15","15-20","20-25","25-30","30-35","35-40","40-45","45-50","50-55","55-60","60-65","65-70","70-75","75-80","85+")
fcol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),17)
mcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),17)
par(mar=pyramid.plot(x,y,labels=agelabels,lxcol=mcol,rxcol=fcol,show.values=TRUE))
title(sub="Tunisian age pyramid in 1994",cex.sub=1.7)
library(plotrix)
x<-c(4.6,4.01,3.71,3.84,4.19,4.10,4.35,3.62,3.25,3.02,2.95,2.44,1.94,1.16,0.98,0.74,0.56)
y<-c(4.25,3.72,3.48,3.69,4.24,4.41,4.61,3.82,3.37,3.2,2.97,2.43,1.94,1.23,1.03,0.78,0.6)
agelabels<-c("0-5","5-10","10-15","15-20","20-25","25-30","30-35",
"35-40","40-45","45-50","50-55","55-60","60-65","65-70","70-75","75-80","85+")
mcol<-color.gradient(c(0,0,0.5,1),c(0,0,0.5,1),c(1,1,0.5,1),17)
fcol<-color.gradient(c(1,1,0.5,1),c(0.5,0.5,0.5,1),c(0.5,0.5,0.5,1),17)
par(mar=pyramid.plot(x,y,labels=agelabels,lxcol=mcol,rxcol=fcol,show.values=TRUE))
title(sub="Tunisian age pyramid in 2014",cex.sub=1.7)
In 1994 the pyramid was shaped by a broad base which characterizes the young countries.
In 2014 it was in a shape which characterizes developed countries: declining birth rate and aging population. It showed a decline of birth on the slices of 0 to 25 years between 1994 and 2014.
The pyramid has thickened in the middle, a sign of improving quality of life and a decrease of mortality.
We also note an increase in the age group over 80 years, this slice has quadrupled in percentage between 1994 and 2014. Thus, the median age in Tunisia rose to 31.4 years in 2014. That means that half of the population is older and the other half is younger.
The National Public Health Institute, revealed that in Tunisia, the increasing share of elderly in the population pyramid depends on three main factors, namely: declining fertility, reducing mortality and improving life expectancy at birth which rose from 50 years in 1960 to 75 years today. We also notice a significant improvement of hygiene and health conditions, income and recreation.