Home | GLMs | Multilevel | Survival | Demography | Stata | R

Stable Populations

In this unit we do some stable population calculations, including determination of the intrinsic growth rate, as illustrated in Box 7.1, and computing the stable equivalent age distribution, as illustrated in Box 7.2 in the textbook.

In this version we do all calculations using plain Stata, and therefore skip the calculation of Lotka's r from the Leslie matrix. An alternative version using Mata is available here.

Box 7.1. The Population of Egypt

We use the Egyptian example in Box 7.1 of the textbook to illustrate Coale's method of calculating Lotka's r. We start by entering person-years lived for ages 15-19 to 45-49 and the maternity function at those ages. We then calculate the midpoints of the age groups.

. input L m

              L           m
  1.    4.6674     .00567
  2.    4.63097    .06627
  3.    4.58518    .11204
  4.    4.53206    .07889
  5.    4.46912    .05075
  6.    4.39135     .0159
  7.    4.28969     .0061  
  8. end

. gen a = 12.5 + 5*_n

The Net Reproduction Ratio

The Net Reproduction Ratio NRR is easily computed as the sum of the products of the survival ratios and the maternity function

. gen netm = L * m

. quietly summarize netm

. scalar nrr = r(sum)

. display nrr
1.5274137

The NRR is 1.527 daughters per woman, in agreement with the textbook.

Coale's Method for Estimating r

Next we solve Lotka's equation. Coale's method follows from a Taylor expansion of Lotka's integral (equation 7.10b in the text) which I'll call f(r), and its first derivative f'(r)=-f(r)A(r) where A is the mean age of childbearing written as a function of r. If r0 is a trial value and r the true value or solution, write f(r0) = f(r) + (r0-r)f'(r) and note that f(r)=1 and f'(r)=-A where A is the true mean age of childbearing in the stable population. The next trial value would then be r = r0 + (f(r0)-1)/A. As the textbook notes, we don't know A until we know r, so we use an approximation, in this example 27. For a starting value we use r = log(NRR)/A.

To apply the method we need to a discrete approximation to Lotka's integral given a trial value of r. Here we use log(NRR)/27 as a trial value

. scalar r = log(nrr)/27

. display r
.015688

. gen fra = exp(-r * a) * L * m   // Lotka's integrand

. quietly summarize fra

. display r(sum)
.95837278

As you can see, with the trial value of r=0.015688 the integral comes to 0.95837 which is short of 1, so we reduce r a bit, dividing the shortfall by 27, and try again. Let us do three iterations

. forvalues niter =1/3 {
  2.         scalar r = r + (r(sum)-1)/27
  3.         quietly replace fra = exp(-r * a) * L * m
  4.         quietly summarize fra
  5.         display "r = " r " integral " r(sum)
  6. }
r = .01414625 integral 1.002887
r = .01425317 integral .99973133
r = .01424322 integral 1.0000246

The three iterations are the same as in the textbook. The intrinsic growth rate of Egypt in 1997 was .01425.

The Mata handout shows how to speed up the iterative procedure using exact first derivatives.

Box 7.2 The Population of the U.S.

Let us turn to the example in Box 7.2, which involves the female population of the U.S. in 1991. The data include the actual age distribution as well as the person-years lived and the maternity function. These are available in a file called prestonBox72.dat in the datasets section.

. infile age ca L m using ///
>   http://data.princeton.edu/eco572/datasets/prestonBox72.dat, clear
(18 observations read)

. list

     +-------------------------------+
     | age      ca         L       m |
     |-------------------------------|
  1. |   0   .0726   4.95804       0 |
  2. |   5   .0689   4.95002       0 |
  3. |  10   .0667   4.94603   .0007 |
  4. |  15   .0648   4.93804   .0303 |
  5. |  20   .0729   4.92552   .0566 |
     |-------------------------------|
  6. |  25   .0799   4.91138   .0578 |
  7. |  30   .0861   4.89356   .0388 |
  8. |  35   .0801   4.86941   .0157 |
  9. |  40   .0735   4.83577   .0027 |
 10. |  45   .0556   4.78475   .0001 |
     |-------------------------------|
 11. |  50   .0464   4.70374       0 |
 12. |  55   .0421   4.57712       0 |
 13. |  60   .0436   4.38502       0 |
 14. |  65   .0429   4.10756       0 |
 15. |  70   .0365    3.7199       0 |
     |-------------------------------|
 16. |  75   .0294   3.19192       0 |
 17. |  80   .0203   2.49203       0 |
 18. |  85   .0176   2.73044       0 |
     +-------------------------------+

We skip the eigenanalysis of the Leslie matrix, which requires a matrix package (such as Mata, R, Gauss, or Matlab).

Estimating r using Coale's Method

Let us now calculate the rate using Coale's method to solve Lotka's equation iteratively. We start by computing the NRR, which as you would expect is less than one. We also need the midpoints of the age groups. For the last group we use 6.79, life expectancy at age 85, as in the textbook

. gen netm = m * L

. quietly summarize netm

. scalar nrr = r(sum)

. display nrr
.99560195

. gen a = age + 2.5

. replace a = 85 + 6.79 in -1
(1 real change made)

We now compute our trial value and Lotka's integral

. scalar r = log(nrr)/27

. display r
-.00016325

. gen fra = exp(-r * a) * L * m

. quietly summarize fra

. di r(sum)
.99991441

Next we do three iterations

. forvalues niter=1/3 {
  2.         scalar r = r + (r(sum)-1)/27
  3.         quietly replace fra = exp(-r * a) * L * m
  4.         quietly summarize fra
  5.         display "r = " r " integral " r(sum)
  6. }
r = -.00016642 integral .99999834
r = -.00016648 integral .99999997
r = -.00016648 integral 1

As you can see the method settles on r = -0.0001665. Note that there is a typo in the textbook, which reports r as -.00018 on page 150.

Obtaining the Equivalent Age Distribution

The final step will be to calculate the stable equivalent age distribution. This is a simple function of r and the person-years lived. (It also involves the birth rate, but that is also a function of r and person-years lived.) Below we compute b and then the age distribution

. gen eral = exp(-r * a) * L

. quietly summarize eral

. scalar b = 1/r(sum)

. display b
.01258426

. gen sa = b * exp(-r * a) * L    

Let us now plot the current and stable age distributions using the midpoints of the age groups

. line ca sa a, lpat(dash solid) ///
>         xtitle("age") ytitle(Prop in 5-year age group) ///
>         title(Actual and Stable Equivalent Age Distributions) ///
>         subtitle(U.S. females 1991) ///
>         legend(order(1 "Actual" 2 "Stable") col(1) ring(0) pos(1))

. graph export stablepop0.png, replace
(file stablepop0.png written in PNG format)

The graph reproduces Figure 7.4 in the textbook, showing how the current age distribution has proportionately more people at young ages (up to 40-44) and fewer at old ages (45-49 and up).

Question: On our way to the stable age distribution we computed the intrinsic birth rate. What's the intrinsic death rate?