help for tfr2

Title

tfr2 -- Age-specific fertility rates (ASFRs), total fertility rates (TFRs), fertility trends and rate ratios from birth histories

-- Please report problems and send comments and suggestions to bruno.schoumaker@uclouvain.be

Table of contents

Syntax
Description
Options
Examples

Acknowledgments
Citing tfr2
References
Disclaimer
Author

Syntax

tfr2 [ varlist ] [ if exp ]
[ pweight = exp ]
[ , options ]

options summary default

Main
bvar(varlist) names of birth variables b3_01 to b3_20 (or lower)
length(integer) length of the period for the computation of the rates (years) 3
dates(var) date of survey (CMC) v008
wbirth(var) date of birth of woman (CMC) v011
ageg(integer) size of age groups (years) 5
Options
cluster(var) cluster identifiers jackknife
awf(var) all women factor awfactt
trend(integer) time intervals for fertility trends (years)
minage(integer) minimum age for ASFRs and TFR (years) 15
maxage(integer) maximum age for ASFRs and TFR (years) 49
endy(integer) defines the last year of the estimation period
entry(var) date of entry in the risk set (e.g. marriage for marital fertility rates) in CMC
cyears rates computed over calendar years
frm uses fractional months (day of birth is randomly attributed to women and children)
norates ASFRs are not displayed
notfr TFR is not displayed
mac computes mean age at childbearing
se standard errors of rates are saved and/or confidence intervals displayed on graphs
level(#) specifies the confidence level for confidence intervals 95

Saving options
savetable(filename) saves table of births and exposure in a Stata file
saverates(filename) saves ASFRs and TFR in a Stata file
savetrend(filename) saves TFRs in a Stata file
onlytab only saves the table of births and exposure - rates are not computed
Graph options
grates Graph of ASFRs
gtrend Graph of trend of TFRs (works with the option trend)
Input options
input(string) format of input data file (wide or table) wide

Other options
dv displays the name of the variables used by tfr2

by is allowed with tfr2.

xi is allowed with tfr2.

pweight is allowed with tfr2. By default, v005 is used as the weighting variable (name of weights in DHS).

Note that tfr2 will work under Stata 10.0 onward.

Note that tabexp must be installed for tfr2 to work.

Description

tfr2 is a program for analyzing birth histories from demographic surveys. It computes fertility rates, reconstructs fertility trends, and compute rate ratios for recent fertility. It is conceived to be used
with individual recode files of Demographic and Health Surveys (DHS), but can be used with any data file organized like a DHS file (see example with WFS data below).

tfr2 notably can be used to replicate results published in DHS reports (http://www.measuredhs.com/help/Datasets/Age-Specific_Fertility_Rates.htm).

The data file must be organized using the following principles : (1) each line corresponds to a woman. (2) the dates of births (in CMC) of all the children are recorded in seperate variables (e.g. b3_01 b3_02...b3_20).
This is the way birth histories are organized in DHS standard recode data files.

All dates should be in Century Month Code (CMC).

The following table illustrates the data of a birth history in a DHS. v008 is the date of the survey, v011 is the date of birth of the woman, and b3_01, b3_02,... are the dates of births of all the children.

The order of births does not matter.

+
+
| id v008 v011 b3_01 b3_02 b3_03 ...|
|
|
| 1 1050 491 1004 943 935 |
| 2 1048 795 1011 . . |
| 3 1047 708 946 . . |
| 4 1050 833 . . . |
+
+

tfr2 computes age-specific fertility rates (ASFRs) and total fertility rates (TFRs)
on periods defined in various ways (e.g. 3 years before the survey, 5 years before the survey,
last 5 calendar years...). Standard errors of ASFRs and TFRs can be computed with jackknife to take account
of clustering.

Rates are computed between exact ages (in rectangles of Lexis diagrams). By default, they are computed for periods defined as "years preceding the survey", but they can be estimated by calendar years (cy).

Both general fertility rates and marital fertility rates can be computed. Marital fertility rates are computed by defining the date of marriage as the entry date (e.g. entry(v509)).

tfr2 also allows reconstructing fertility trends using Poisson regression. This approach relies on the
assumption that the age pattern of fertility is constant over time.

tfr2 can be used to estimate rate ratios of explanatory variables. Rate ratios are obtained through a Poisson regression. This approach relies on the
assumption that the age pattern of fertility is constant across values of the covariates.

Options

Contents

Main
Options
Save options
Graph options

Main options

bvar(varlist) indicates the name of the variables containing the birth dates of the children.
if not indicated, b3* is used as the variable names. The birth dates of children should be
in CMC.

length(#) indicates the length of the period for the computation of fertility rates.
By default, the length is equal to 3 years.

dates(varname) is a variable containing the date of the survey (in CMC). By default, v008 is used. You can also remove some months from the date of the survey.
For instance, instead of dates(v008) you can enter dates(v008-36).

wbirth(varname) is a variable containing the date of birth of women (in CMC). By default, v011 is used.

ageg(#) is the size of age groups for the computation of ASFRs. By default, 5-year age groupes are used.

Options

cluster(varname) indicates the name of the variable containing the identifiers of the primary sampling units (usually v021 in DHS).
If cluster is used, standard errors of rates are computed with jackknife.

awf(varname) indicates the name of the variable containing the "all women factor" to be used. This is necessary in surveys where only
ever married women were interviewed (e.g. Bangladesh, Pakistan,...). By default, the variable awfactt is used.

trend(#) is used to compute fertility trends. The integer indicates the size of the intervals for computing TFRs. For instance, a value of 1 means that
annual fertility rates are computed. If trend is used, it should be lesser or equal than length.

minage(#) is used to set the minimum age to compute fertility rates. The default value is 15.

maxage(#) is used to set the maximum (completed) age to compute fertility rates. The default value is 49.

endy(#) is used to define the last year of the estimation period. It overrides dates if both are used.

entry(varname) is used to compute fertility rates after a date (that may vary across individuals). For instance, it can be used to compute marital fertility rates, by including the date of marriage (in CMC).

cyears is used to compute fertility rates over calendar years. By default, rates are computed for years preceding the survey.

norates ASFRS are not displayed.

notfr TFR is not displayed.

mac computes and displays mean age at childbearing.

se indicates that standard errors of rates are saved and/or confidence intervals displayed on a graph.

level(#) specifies the confidence level for confidence intervals. The default value is 95 (95% confidence intervals). # may be between 10.00 and 99.99.

Save options

savetable(filename) saves the table including births and exposure used to estimate rates in a Stata file. To overwrite an existing file, use savetable(filename, replace)

saverates(filename) saves fertility rates in a Stata data file. To overwrite an existing file, use saverates(filename, replace)

savetrend(filename) saves trends of TFRs in a Stata data file. To overwrite an existing file, use savetrend(filename, replace)

onlytab only saves the table of births and exposure. No other output is produced.

Graph options

grates displays a graph of age-specific fertility rates

gtrend displays a graph of the trend of TFRs (works with the trend option).

Input options

input(wide|table) This allows using tfr2 with individual data (wide, default option), or with a table of births and exposure (table). Currently, only tables prepared by tabexp are supported if you use input(table).

Other options

dv displays the names of the variables used by tfr2. This is useful for checking that the correct variables are used.

Examples with DHS data

Individual recode data files can be obtained from MeasureDHS (www.measuredhs.com).
Once you have downloaded the individual recode Stata file for a survey, open it:

. use KEIR51FL.DTA, clear

This opens the file of the 2008 Kenya DHS.

tfr2 can then be used to compute fertility rates, fertility trends, rate ratios of explanatory variables.

Fertility levels

Fertility rates for last x years before the survey

. tfr2

ASFRs (5-year age groups) and TFRs for the 3 years preceding the survey

This is equivalent to

. tfr2 [pweight=v005], ageg(5) len(3) wb(v011) dates(v008) awf(awfactt)

ASFRs (5-year age groups) and TFRs for the 3 years preceding the survey.

. tfr2, len(5)

ASFRs (5-year age groups) and TFRs for the 5 years preceding the survey.

. tfr2, len(1)

ASFRs (5-year age groups) and TFRs for the year preceding the survey.

. tfr2, ageg(1)

ASFRs (by single year) and TFRs for the 3 years preceding the survey.

. tfr2, norates

TFRs for the 3 years preceding the survey.

Fertility rates for x calendar years before the survey

. tfr2, len(4) cy

ASFRs (5-year age groups) and TFRs for the 4 calendar years preceding the survey
(if the survey was conducted in 1999 - rates computed for the period 1995-1998).

Fertility rates for last x years before the survey and jackknife standard errors

. tfr2, len(3) cluster(v001)

ASFRs (5-year age groups) and TFRs for the 3 years preceding the survey
with jackknife standard errors.

Fertility rates for last x specific calendar years

. tfr2, len(3) endy(1999)

ASFRs (5-year age groups) and TFRs for the 3-year period ending in 1999.
Rates are computed for the period from 1/1997 to 12/1999.

Marital fertility rates for the x years preceding the survey

. tfr2, len(5) entry(v509)

Marital ASFRs (5-year age groups) and TFRs for the 5 years preceding the survey.

Fertility trends

Fertility trends by calendar years for x calendar years before the survey

. tfr2, len(15) trend(1) cy

TFRs(15-49) for the 15 calendar years preceding the survey.

Fertility trends by calendar years for x calendar years before the survey between ages 20 and 39

. tfr2, len(15) trend(1) mina(20) maxa(39) cy

TFRs(20-39) for the 15 calendar years preceding the survey.

Explanatory variables

Fertility rates for x calendar years before the survey by categories of a variable

. by v106, sort : tfr2

ASFRs (5-year age groups) and TFRs for the 3 years preceding the survey by category of v106.

. by v025, sort : tfr2, awf(awfactu)

Same as in previous example, but the 'all women factor' is used for rural-urban comparisons.

Fertility rates for the x years preceding the survey and rate ratios for categories of variable

. xi: tfr2 i.v106, len(5)

ASFRs (5-year age groups) and TFRs for the 5 years preceding the survey for the reference category of v106 (education in DHS).
Rate ratios for the other categories of v106.

Saving files and displaying graph

Fertility rates for x calendar years before the survey - saved in a file and displayed on a graph

. tfr2, len(4) cy gr saver(c:\rates, replace)

TFRs(15-49) for the 4 calendar years preceding the survey, saved in a file and displayed on a graph.

Fertility trends for x calendar years before the survey - saved in a file and displayed on a graph

. tfr2, len(15) trend(1) cy gt savetr(c:\trend, replace)

TFRs(15-49) for the 15 calendar years preceding the survey, saved in a file and displayed on a graph.

Fertility trends for x calendar years before the survey - saves table of births and exposure in a file

. tfr2, len(5) trend(1) cy gt savet(c:\birth_exp, replace)

TFRs(15-49) for the 5 calendar years preceding the survey, table of births and exposure saved in a file.

Fertility rates for x calendar years before the survey - displayed on a graph with 95% confidence interval

. tfr2, len(4) cy gr se

TFRs(15-49) for the 4 calendar years preceding the survey, displayed on a graph with 95% confidence interval.

Examples with WFS data

Fertility rates for last 3 years before the survey by single year of age

. use http://data.princeton.edu/eco572/datasets/cofertx, clear
. tfr2, dates(v007) wb(v008) bvar(b0*2 b1*2) ageg(1)

This replicates the computation of fertility rates in the 1976 WFS in Colombia
as on Germán Rodriguez's website (http://data.princeton.edu/eco572/asfr.html).

Acknowledgements

Thanks to all the users who have provided useful feedback.

Citing tfr2

Schoumaker Bruno (2012), "A Stata module for computing fertility rates and TFRs from
birth histories: tfr2", Demographic Research, vol. 28.

References

Rutstein S.O, Rojas G. (2006), Guide to DHS Statistics, Demographic and Health Surveys, ORC Macro, Calverton.

Schoumaker Bruno (2004), "A person-period approach to analyzing birth histories", Population-E, vol.59, pp. 689-702.

Schoumaker Bruno (2012), "A Stata module for computing fertility rates and TFRs from
birth histories: tfr2", Demographic Research, vol. 28.

Disclaimer

Disclaimer: There is no warranty on this program either expressed or implied.

Author

Bruno Schoumaker
Centre de recherche en demographie et societes
Universite catholique de Louvain
Belgium
bruno.schoumaker@uclouvain.be

Version 1.1.1c 17May2013