The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Topics » Unmet Need » Matching unmet need for family planning in India_2019/21 (Matching unmet need for family planning rate calculated from 2019/21 DHS survey data with that in the report of India)
Re: India 2021 v626a unmet not matching published numbers [message #24840 is a reply to message #24835] Tue, 19 July 2022 04:06 Go to previous messageGo to previous message
mahfuz.ru.pops@gmail.com is currently offline  mahfuz.ru.pops@gmail.com
Messages: 14
Registered: July 2022
Member
Following could be the correct code of Stata:

g unmet=.
**Set unmet need to NA for unmarried women if survey only included ever-married women or only collected necessary data for married women
replace unmet=98 if v502!=1 & (v020==1 | substr(v000,3,1)=="2" | v000=="IA4" )

** CONTRACEPTIVE USERS - GROUP 1
* using to limit if wants no more, sterilized, or declared infecund
recode unmet .=4 if v312!=0 & (v605>=5 & v605<=7)
* using to space - all other contraceptive users
recode unmet .=3 if v312!=0

**PREGNANT or POSTPARTUM AMENORRHEIC (PPA) WOMEN - GROUP 2
* Determine who should be in Group 2
* generate time since last birth
g tsinceb=v222
* generate time since last period in months from v215
g tsincep=int((v215-100)/30) if v215>=100 & v215<=190
replace tsincep = int((v215-200)/4.3) if v215>=200 & v215<=290
replace tsincep = (v215-300) if v215>=300 & v215<=390
replace tsincep =(v215-400)*12 if v215>=400 & v215<=490
* initialize pregnant or postpartum amenorrheic (PPA) women
g pregPPA=1 if v213==1 | m6_1==96
* For women with missing data or "period not returned" on date of last menstrual period, use information from time since last period
* if last period is before last birth in last 5 years
replace pregPPA=1 if (m6_1==. | m6_1==99 | m6_1==97) & tsincep>tsinceb & tsinceb<60 & tsincep!=. & tsinceb!=.
* or if said "before last birth" to time since last period in the last 5 years
replace pregPPA=1 if (m6_1==. | m6_1==99 | m6_1==97) & v215==995 & tsinceb<60 & tsinceb!=.
* select only women who are pregnant or PPA for <24 months
g pregPPA24=1 if v213==1 | (pregPPA==1 & tsinceb<24)

* Classify based on wantedness of current pregnancy/last birth
* current pregnancy
g wantedlast = v225
* last birth
replace wantedlast = m10_1 if (wantedlast==. | wantedlast==9) & v213!=1
* no unmet need if wanted current pregnancy/last birth then/at that time
recode unmet .=7 if pregPPA24==1 & wantedlast==1
* unmet need for spacing if wanted current pregnancy/last birth later
recode unmet .=1 if pregPPA24==1 & wantedlast==2
* unmet need for limiting if wanted current pregnancy/last birth not at all
recode unmet .=2 if pregPPA24==1 & wantedlast==3
* missing=missing
recode unmet .=99 if pregPPA24==1 & (wantedlast==. | wantedlast==9)

**NO NEED FOR UNMARRIED WOMEN WHO ARE NOT SEXUALLY ACTIVE
* determine if sexually active in last 30 days
g sexact=1 if v528>=0 & v528<=30
* older surveys used code 95 for sex in the last 4 weeks
recode sexact .=1 if v528==95
* if unmarried and not sexually active in last 30 days, assume no need
recode unmet .=97 if v502!=1 & sexact!=1

**DETERMINE FECUNDITY - GROUP 3 (Boxes refer to Figure 2 flowchart in report)
**Box 1 - applicable only to currently married
* married 5+ years ago, no children in past 5 years, never used contraception, excluding pregnant and PPA <24 months
g infec=1 if v502==1 & v512>=5 & v512!=. & (tsinceb>59 | tsinceb==.) & v302a==0 & pregPPA24!=1
cap replace infec=1 if v502==1 & v512>=5 & v512!=. & (tsinceb>59 | tsinceb==.) & v302a==0 & pregPPA24!=1 & (substr(v000,3,1)=="6" | substr(v000,3,1)=="7")
* declared infecund on future desires for children
replace infec=1 if v605==7
**Box 3
* menopausal/hysterectomy on reason not using contraception
cap replace infec=1 if v3a08d==1 & (substr(v000,3,1)=="4" | substr(v000,3,1)=="5" | substr(v000,3,1)=="6" | substr(v000,3,1)=="7")
**Box 4
* Time since last period is >=6 months and not PPA
replace infec=1 if tsincep>=6 & tsincep!=. & pregPPA!=1
**Box 5
* menopausal/hysterectomy on time since last period
replace infec=1 if v215==994
* hysterectomy has different code for some surveys
replace infec=1 if v215==993
* never menstruated on time since last period, unless had a birth in the last 5 years
replace infec=1 if v215==996 & (tsinceb>59 | tsinceb==.)
**Box 6
*time since last birth>= 60 months and last period was before last birth
replace infec=1 if v215==995 & tsinceb>=60 & tsinceb!=.
* Never had a birth, but last period reported as before last birth - assume code should have been 994 or 996
replace infec=1 if v215==995 & tsinceb==.
* exclude pregnant and PP amenorrheic < 24 months
replace infec=. if pregPPA24==1
recode unmet .=9 if infec==1

**FECUND WOMEN - GROUP 4
* wants within 2 years
recode unmet .=7 if v605==1
* wants in 2+ years, wants undecided timing, or unsure if wants
recode v605 .=4 if v000=="IA4"
recode unmet .=1 if v605>=2 & v605<=4
* wants no more
recode unmet .=2 if v605==5
recode unmet .=99

la def unmet ///
1 "unmet need for spacing" ///
2 "unmet need for limiting" ///
3 "using for spacing" ///
4 "using for limiting" ///
7 "no unmet need" ///
9 "infecund or menopausal" ///
97 "not sexually active" ///
98 "unmarried - EM sample or no data" ///
99 "missing"
la val unmet unmet


recode unmet (1/2=1 "unmet need") (else=0 "no unmet need"), g(unmettot)
* generate sampling weight
g wgt=v005/1000000
* tabulate for currently married women
ta unmet if v502==1 [iw=wgt], m
ta unmettot if v502==1 [iw=wgt]
* all women
ta unmet [iw=wgt]
ta unmettot [iw=wgt]
* sexually active unmarried
ta unmet if v502!=1 & sexact==1 [iw=wgt]
ta unmettot if v502!=1 & sexact==1 [iw=wgt]

ta v626 if v502==1 [iw=wgt], m

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Unmet need
Next Topic: District level estimation
Goto Forum:
  


Current Time: Fri Apr 26 23:34:59 Coordinated Universal Time 2024