Replicability Materials for Demographic Research 51-9, "Data errors in mortality estimation: Formal demographic analysis of under-registration, under-enumeration, and age misreporting" Authors: Carl Schmertmann Bernardo Lanza Queiroz Marcos Gonzaga All replication files are also available on github, at https://github.com/schmert/DR-errors-in-mortality-data ================================================================================== The .zip file contains data and R code for complete replication of the calculations and figures in the published paper. We performed all calculations in R, Version 4.1.2. Note that the code uses the {here} package for file references. ================================================================================== MAIN CODE FILES ================================================================================== There are THREE MAIN FILES, in the /Code directory. When executed in order, they will perform all of the calculations reported in the paper. File names, which include the order in which they should be run, are: 1-construct-Palloni-PI-IUV.R 2-construct-Preston-and-Bhat-PI-via-nonlinear-fits-to-group-tables.R 3-construct-plots-for-paper.R ------------ 1-construct-Palloni-PI-IUV.R ------------ Builds a 111 x 111 age misstatement matrix that closely approximates the single-year reporting probabilities from Palloni, A., Beltrán-Sánchez, H., and Pinto, G. (2021). Estimation of older-adult mortality from information distorted by systematic age misreporting. Population Studies 75(3): 403–420. Weblink: doi:10.1080/00324728.2021.1918752 Rows and columns of the calculated matrix PI correspond to single-year ages 0,1,2,...,109,110+. The element in row x, column y is the probability that an individual with true age y has reported age x. Columns of PI sum to one. ------------ 2-construct-Preston-and-Bhat-PI-via-nonlinear-fits-to-group-tables.R ------------ Builds two 111 x 111 age misstatement matrices, one that approximates the five-year reporting probabilties from Bhat, P.M. (1990). Estimating transition probabilities of age misstatement. Demography 27(1): 149–163. Weblink: doi:10.2307/2061559 and another that approximates the five-year reporting probabilties from Preston, S.H., Elo, I.T., and Stewart, Q. (1999). Effects of age misreporting on mortality estimates at older ages. Population Studies 53(2): 165–177. Weblink: doi:10.1080/00324720308075 ------------ 3-construct-plots-for-paper.R ------------ Executes all of the paper's calculations and produces the published Figures. ================================================================================== OTHER CODE FILES ================================================================================== There are several additional R scripts in the /Code directory that serve as subroutines or code chunks that are called by the 3 main files. They are ------------ SP-male-2010-Nx-Dx.R ------------ Creates data vectors for observed exposure (Nx) and reported deaths (Dx) for males in the Brazilian state of São Paulo, 2009-2011. ------------ construct-smooth-logmx-schedule-for-SP.R ------------ Smooths the raw Nx and Dx data vectors and outputs log mortality rates for ages 0,1,2,...,119 that closely approximate the São Paulo input data. This smoothed schedule serves as the basis for the stationary population that is used in many of the subsequent calculations. ------------ mortality-info-function.R ------------ Defines a function called mortality_info(.,.) that calculates several summary measures for mortality rates from age-specific death and exposure data ------------ kannisto-function.R ------------ Defines a function called Kannisto(.) that extends a logmx schedule to very old ages (e.g., 90-119) by fitting a regression to the logits of high ages (e.g. 70-89) ------------ make-age-group-misstatement-tables.R ------------ Creates data frames called Bhat_table and Preston_table that contain published age misreporting probabilties from the Bhat (1990) and Preston et al. (1999) articles cited above. ------------ under-registration-calculations.R ------------ Performs the derivative calculations for Figure 1. ================================================================================== /Data /Plots /Tables ================================================================================== These subdirectories contain the intermediate files and results from the three main programs. In particular, the /Plots directory contains all of the Figures created by "3-construct-plots-for-paper.R".