Using the Fertility and Contraception Calendar Data

A survey redesign was implemented in 2019 PMA baseline surveys. The redesign included a longitudinal component and calendar data. The baseline samples in 2019 for Kenya, Nigeria, Democratic Republic of the Congo, and Burkina Faso contain calendar data variables, which are string variables containing 3 years of retrospective contraceptive calendar data. The strings are comma-delimited codes reading from January 2017 from right to left, with each code representing a month. Below is Stata code for making Kenya and Nigeria calendar variables easier to use. Code for the remaining countries and other statistical packages are forthcoming. The following are a key to the codes from these variables:

B
Birth
P
Pregnant
T
Pregnancy ended
0
No family planning method used
1
Female Sterilization
2
Male Sterilization
3
Implant
4
IUD
5
Injectables
7
Pill
8
Emergency Contraception
9
Male Condom
10
Female Condom
11
Diaphragm
12
Foam / Jelly
13
Standard Days / Cycle beads
14
LAM
30
Rhythm method
31
Withdrawal
39
Other traditional methods

Kenya 2019

Stata


*KENYA 2019*
clear
use "[insert filepath here]/pma_####.dta"
set more off

*Keep only female records
keep if fqinstid != ""

*********************************
********SPLIT STRING VARS********
*********************************

*Kenya calendar variable starts in Jan 2017, 36 entries
*splitting the calendar data up into individual variables where commas were in the original variable
split calendarke, p(,) gen(cal_ke)

*****************************************
********RESHAPE FROM WIDE TO LONG********
*****************************************

*changing from wide form to long form, indicating that cal_ke is a time variant variable
reshape long cal_ke, i(fqinstid) j(month)

*Drop cases with no data
drop if cal_ke ==""

*********************************
********RECODE VARIABLES*********
*********************************

*The calendars read from right to left from the earliest month to the most recent month
*this line reorders the months so that month 1 is the earliest month.  The earliest month is now 36
replace month = 37 - month
sort fqinstid month


*cmc is the century-month format, because month 1 is January 2017, or CMC 1405
*CMC (Century-month code) is (Year - 1900)*12 + Month
gen cmc = month + 1404


*some clean up - create new version, convert birth, termination, and pregnant into codes and destring
gen numcal_ke = cal_ke
replace numcal_ke = "90" if numcal_ke == "P"
replace numcal_ke = "91" if numcal_ke == "T"
replace numcal_ke = "92" if numcal_ke == "B"
destring numcal_ke, replace

*create labels
label define calendar 92 "Birth" 90 "Pregnant" 91 "Pregnancy ended" 0 "No family planning method used" 1 "Female Sterilization" 2 "Male Sterilization" 3 "Implant" 4 "IUD" 5 "Injectables" 7 "Pill" 8 "Emergency Contraception" 9 "Male Condom" 10 "Female Condom" 11 "Diaphragm" 12 "Foam / Jelly" 13 "Standard Days / Cycle beads" 14 "LAM" 30 "Rhythm method" 31 "Withdrawal" 39 "Other traditional methods"
*apply labels
label values numcal_ke calendar


*Recode numcal_ke to create a variable that only contains data on FP method
recode numcal (90/92=0), gen(method)

*Recodes method numbers to align with other integrated variables in IPUMS PMA
recode method (1=101) (2=102) (3=111) (4=112) (5=120) (7=131) (8=132) (9=141) (10=142) (11=151) (12=153) (13=160) (14=170) (30=210) (31=220) (39=240)
label define yes_no 0 "No" 1 "Yes" 99 "NIU (not in universe)"
label define methods 101 "Female Sterilization" 102 "Male Sterilization" 111 "Implants" 112 "IUD" 120 "Injectables" 121 "  Injectables (3 months)" 122 "  Injectables (monthly)" 131 "Pill" 132 "Emergency Contraception" 140 "Condom" 141 "  Male condom" 142 "  Female condom" 150 "Diaphragm/foam/jelly" 151 "  Diaphragm" 152 "  Foam" 153 "  Foam/Jelly" 160 "Standard Days/Cycle Beads Method" 170 "Lactational amenorrhea method (LAM)" 180 "N tablet" 199 "Other modern method" 200 "TRADITIONAL METHODS" 210 "Rhythm" 220 "Withdrawal" 230 "Washing " 240 "Other traditional"
label values method methods

label variable method "FP method used"

Nigeria 2019

Below is example Stata code for converting the Nigeria 2019 calendar data into long form numeric data.

The Nigeria 2019 calendar data has an additional level of information. In addition to the contraceptive calendar, there is also a string variable that contains the reason the woman stopped using a family planning method (CALENDARNGWHY). The following code also extracts these data. See below the Stata code for the codes and labels for CALENDARNGWHY.

Codes for CALENDARNGWHY

1
Infrequent sex / husband away
2
Became pregnant while using
3
Wanted to become pregnant
4
Husband / partner disapproved
5
Wanted more effective method
6
Side effects / health concerns
7
Lack of access / too far
8
Costs too much
9
Inconvenient to use
10
Up to God / fatalistic
11
Difficult to get pregnant / menopausal
12
Marital dissolution / separation
96
Other

Stata


clear
use "[insert filepath here]/pma_####.dta"
set more off

*Keep only female records
keep if fqinstid != ""

*********************************
********SPLIT STRING VARS********
*********************************

*The Nigeria calendar variable starts in Jan 2017, 36 entries, first 10-11 blank
*splitting the calendar data up into individual variables where commas were in the original variable
split calendarng, p(,) gen(cal_ng)
split calendarngwhy, p(,) gen(calwhy_ng)

*****************************************
********RESHAPE FROM WIDE TO LONG********
*****************************************

*changing from wide form to long form, indicating that cal_ng and calwhy_ng are time variant variables
reshape long cal_ng calwhy_ng, i(fqinstid) j(month)

*Drop cases with no data
drop if cal_ng ==""

*********************************
********RECODE VARIABLES*********
*********************************

*The calendars read from right to left from the earliest month to the most recent month
*this line reorders the months so that month 1 is the earliest month.  The earliest month is now 48
replace month = 49 - month
sort fqinstid month


*cmc is the century-month format, because month 1 is January 2017, or CMC 1405
*CMC (Century-month code) is (Year - 1900)*12 + Month
gen cmc = month + 1404


**some clean up - create new version, convert birth, termination, and pregnant into codes and destring
gen numcal_ng = cal_ng
gen numcalwhy_ng = calwhy_ng
replace numcal_ng = "90" if numcal_ng == "P"
replace numcal_ng = "91" if numcal_ng == "T"
replace numcal_ng = "92" if numcal_ng == "B"
destring numcal_ng, replace
destring numcalwhy_ng, replace

*create labels
label define calendar 92 "Birth" 90 "Pregnant" 91 "Pregnancy ended" 0 "No family planning method used" 1 "Female Sterilization" 2 "Male Sterilization" 3 "Implant" 4 "IUD" 5 "Injectables" 7 "Pill" 8 "Emergency Contraception" 9 "Male Condom" 10 "Female Condom" 11 "Diaphragm" 12 "Foam / Jelly" 13 "Standard Days / Cycle beads" 14 "LAM" 30 "Rhythm method" 31 "Withdrawal" 39 "Other traditional methods"
*apply labels
label values numcal_ng calendar

*Recode numcal_ng to create a variable that only contains data on FP method
recode numcal_ng (90/92=0), gen(method)

*Recodes method numbers to align with other integrated variables

recode method (1=101) (2=102) (3=111) (4=112) (5=120) (7=131) (8=132) (9=141) (10=142) (11=151) (12=153) (13=160) (14=170) (30=210) (31=220) (39=240)
label define yes_no 0 "No" 1 "Yes" 99 "NIU (not in universe)"
label define methods 101 "Female Sterilization" 102 "Male Sterilization" 111 "Implants" 112 "IUD" 120 "Injectables" 121 "  Injectables (3 months)" 122 "  Injectables (monthly)" 131 "Pill" 132 "Emergency Contraception" 140 "Condom" 141 "  Male condom" 142 "  Female condom" 150 "Diaphragm/foam/jelly" 151 "  Diaphragm" 152 "  Foam" 153 "  Foam/Jelly" 160 "Standard Days/Cycle Beads Method" 170 "Lactational amenorrhea method (LAM)" 180 "N tablet" 199 "Other modern method" 200 "TRADITIONAL METHODS" 210 "Rhythm" 220 "Withdrawal" 230 "Washing " 240 "Other traditional"
label values method methods

*gives labels to reason why stopped using FP
label define reasons 1 "Infrequent sex / husband away" 2 "Became pregnant while using" 3 "Wanted to become pregnant" 4 "Husband / partner disapproved" 5 "Wanted more effective method" 6 "Side effects / health concerns" 7 "Lack of access / too far" 8 "Costs too much" 9 "Inconvenient to use" 10 "Up to god / fatalistic" 11 "Difficult to get pregnant / menopausal" 12 "Marital dissolution / separation" 96 "Other"
label values numcalwhy_ng reasons