In this lab, we will use Japan to illustrate the changes in age-structure that are resulting from the demographic transition and continued population aging.

Specifically, we will investigate:

1. What has happened to the share of elderly and children from World War II until today?

2. What will happen if current levels of fertility and mortality continue?

and

1. How to use stable age-structures and the Solow model to understand the effect of fertility on consumption in the macro-economy.

Note 1: This lab is somewhat longer than previous labs. Please plan accordingly. There is relatively little code for you to write but there is a substantial amount of material to cover.

Note 2: Please be warned of the varying notation for the exponential growth rate of the stable population. Economists use “n” and demographers use “r”. We tend to mix this usage, in class and in this lab.

# Part 0. Preliminaries

# Do not edit this chunk, but *do* press the green button to the answer key for the quiz info (the unreadable string below)
tot = 0
library(quizify)
source.coded.txt(answer.key)

Note: the most helpful readings for this lab is Lee (2003) for Parts 1 and 2 and Lee et al (2014) for parts 3, 4, and 5.

# Part 1. Population change over the demographic transition.

The first declines in mortality and fertility happened gradually in Europe. More recently, the pace of demographic transition has sped up. An early example of rapid demographic change, for which we have excellent statistics, is Japan.

Until shortly after World War II, Japanese fertility remained high. Mortality rates were improving, and the resulting population growth was very fast – indeed, rapid population growth was one of the reasons that Japan gave for expanding its empire.

After the War, fertility began to decline very rapidly.

## get TFR data from a file on our server
year.vec <- tfr.data$Year tfr.vec <- tfr.data$TFR
plot(year.vec, tfr.vec, type = "o",
main = "Japanese Period Total Fertility Rate")

In less than a decade, fertility fell to replacement levels near two children per woman.

Q1.1 What do you think happened in 1966?

A. There was a mistake in the data collection. Records were lost, or a calculation error must have been made.

B. The economy crashed

C. 1966 was an inauspicious year according to the Japanese zodiac, the year of the “fire horse” in which it was unlucky to have a daughter born.

D. Everything in C and further evidence of intentionality is that births were slightly higher both before and after 1966.

##  "Replace the NA with your answer (e.g., 'A' in quotes)"
quiz.check(answer1.1)
Your  answer1.1 : D
Correct.
Explanation:  Google 'Increased induced abortion rate in 1966, an aspect of
.a Japanese folk superstition.' (The next one is 2026).

We can see that the pace of mortality improvement was steady the entire time.

e0.data <- read.table("/data175/japan_e0_female.txt")
year.vec <- e0.data$Year e0.vec <- e0.data$Female
plot(year.vec, e0.vec, type = "o",
main = "Japanese Period Life Expectancy at Birth, Female")

Life expectancy is greatly influenced by the level of child mortality. Right after WWII we see the enormous effects of reducing child mortality. Today, mortality improvement is still steady, but because the increases in survival are at older ages, the same pace of improvement in mortality rates adds fewer years of life expectancy at birth.

Q1.2 What is the pace of life expectancy improvement from 1980 to 2010?

A. About 1 year per year.

C. About 1 month per year

##  "Replace the NA with your answer (e.g., 'A' in quotes)"
quiz.check(answer1.2)
Your  answer1.2 : B
Correct.
Explanation:  Japan has become the world leader both in the level of period
.life expectancy and the pace of improvement

Now we are ready to explore the history of Japan’s age-structure.

## read in matrix of population counts
colnames(tmp) <- gsub("X", "", colnames(tmp))
Nxt.mat <- as.matrix(tmp)
# ages 0-110 are rows of the matrix, years 1947-2015 are on the columns
dim(Nxt.mat)
[1] 111  69
# births for each year are given in the row labeled "0"
print(Nxt.mat["0",]) # or equivalently 'print(Nxt.mat[1,])'
   1947    1948    1949    1950    1951    1952    1953    1954    1955    1956    1957    1958    1959    1960    1961
1855504 2556684 2574462 2551884 2266171 2064338 1944604 1811329 1718212 1683513 1622596 1532070 1609696 1593355 1561461
1962    1963    1964    1965    1966    1967    1968    1969    1970    1971    1972    1973    1974    1975    1976
1562666 1590710 1632791 1686220 1740020 1366045 1902321 1846873 1867598 1875397 1981238 2031447 2069887 2005175 1895777
1977    1978    1979    1980    1981    1982    1983    1984    1985    1986    1987    1988    1989    1990    1991
1817227 1740385 1693313 1625423 1572318 1519929 1506173 1499213 1475690 1421098 1375595 1339677 1304501 1243599 1210966
1992    1993    1994    1995    1996    1997    1998    1999    2000    2001    2002    2003    2004    2005    2006
1217248 1203511 1183835 1219259 1183219 1185310 1190235 1190331 1173903 1163465 1163147 1147730 1117107 1092810 1059566
2007    2008    2009    2010    2011    2012    2013    2014    2015
1086697 1084090 1082996 1057749 1043133 1052895 1031912 1024543 1005404 

Q1.3 What is happening to the number of births from 2014 to 2015?

A. They are increasing as a residual effect of past population growth.

B. They are declining at a rate of 1 or 2 percent a year

##  "Replace the NA with your answer (e.g., 'A' in quotes)"
answer1.3 = 'B'
Warning message:
In scan(file = file, what = what, sep = sep, quote = quote, dec = dec,  :
EOF within quoted string
quiz.check(answer1.3)
Your  answer1.3 : B
Correct.
Explanation:  Fertility has been low so long in Japan that births are
.exponentially declining at a fairly steady rate

Let’s now visualize the change in Japan’s age structure. We start by viewing the change frame-by-frame:

year.vec <- colnames(Nxt.mat)
for (i in 1:length(year.vec))
{
barplot(Nxt.mat[,i], horiz = T,
xlim = c(0, 2.5 * 10^6),
xlab = "Number of people N(x,t)", ylab = "Age x")
title(year.vec[i])
##     Sys.sleep(1/10)
}