R: IIASA/VID population data by age, sex, and education
EduDat
R Documentation
IIASA/VID population data by age, sex, and education
Description
Reconstruction of populations by age, sex and highest level of educational attainment for 142 countries for 1970-2000
using demographic back-projection methods together with education forward projections for 2000-2050.
Usage
data(EduDat)
Format
A data frame with 1009152 observations on the following 7 variables.
cc
a numeric vector containing the UN's country codes
yr
a numeric vector indicating the year of the data point
sex
a character vector
agegr
a numeric vector
scen2
a factor with levels BPCENCERFT_Singapore_TRGETUN
... different population projection scenarios - see References.
variable
a factor with levels e1e2e3e4
value
a numeric vector
... the number of people in the respective country, year, by sex, age, and educational attainment level
Lutz, W., A. Goujon, S. KC, and W. Sanderson. 2007. Reconstruction of populations by age, sex and level of educational attainment for 120 countries for 1970-2000. Vienna Yearbook of Population Research 2007:193-235.
KC, S., B. Barakat, A. Goujon, V. Skirbekk, and W. Lutz. 2010. Projection of populations by level of educational attainment, age, and sex for 120 countries for 2005-2050. Demographic Research 22:383-472.
Examples
library(reshape)
data(EduDat)
data(dictionary)
icountry <- "China"
ipop <- subset(EduDat,cc==getcode(icountry,dictionary) & scen2 != "BP")
ipop <- cast(ipop,yr~scen2,sum)
row.names(ipop) <- ipop[,1]
matplot(as.data.frame(ipop[,-1]),type="l",lwd=3,main=paste("Projected Population 15+ by Education Scenario, ",icountry,sep=""),cex.main=1.8,
xlab="Year",ylab="Total Population in 1000s",xaxt="n",cex=1.5,cex.axis=1.5,cex.lab=1.5)
axis(1,at=1:nrow(ipop),labels=row.names(ipop),cex.axis=1.5)
grid(lwd=2,lty=2)
legend(legend=names(ipop[,-1]),title="Education Scenario: ",
col=1:ncol(ipop[,-1]),lwd=3,lty=1:ncol(ipop[,-1]),
"topleft",inset=c(0.02,0.02),bty="o",bg="grey",cex=1.5)
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(Giza)
Loading required package: reshape
Loading required package: lattice
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/Giza/EduDat.Rd_%03d_medium.png", width=480, height=480)
> ### Name: EduDat
> ### Title: IIASA/VID population data by age, sex, and education
> ### Aliases: EduDat
> ### Keywords: datasets
>
> ### ** Examples
>
>
> library(reshape)
>
> data(EduDat)
> data(dictionary)
>
> icountry <- "China"
> ipop <- subset(EduDat,cc==getcode(icountry,dictionary) & scen2 != "BP")
> ipop <- cast(ipop,yr~scen2,sum)
> row.names(ipop) <- ipop[,1]
> matplot(as.data.frame(ipop[,-1]),type="l",lwd=3,main=paste("Projected Population 15+ by Education Scenario, ",icountry,sep=""),cex.main=1.8,
+ xlab="Year",ylab="Total Population in 1000s",xaxt="n",cex=1.5,cex.axis=1.5,cex.lab=1.5)
> axis(1,at=1:nrow(ipop),labels=row.names(ipop),cex.axis=1.5)
> grid(lwd=2,lty=2)
> legend(legend=names(ipop[,-1]),title="Education Scenario: ",
+ col=1:ncol(ipop[,-1]),lwd=3,lty=1:ncol(ipop[,-1]),
+ "topleft",inset=c(0.02,0.02),bty="o",bg="grey",cex=1.5)
>
>
>
>
>
> dev.off()
null device
1
>