The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Nigeria » chap 9 reproductive health (generate age and period )
chap 9 reproductive health [message #25369] Wed, 12 October 2022 16:12 Go to previous message
anum.ali is currently offline  anum.ali
Messages: 6
Registered: September 2022
Member
Hello

I am trying to generate different indicators for chap 9 for nigeria 2018 to produce different tables the problem is I am trying to generate age through this coding but somehow my software stata keeps on getting stuck and not letting me work please help how else can I produce age variable

choose reference period, last 2 years or last 5 years
*gen period = 24
gen period = 60

if file=="IR" {
gen age = v008 - b3_01

* to check if survey has b19, which should be used instead to compute age.
scalar b19_included=1
capture confirm numeric variable b19_01, exact
if _rc>0 {
* b19 is not present
scalar b19_included=0
}
if _rc==0 {
* b19 is present; check for values
summarize b19_01
if r(sd)==0 | r(sd)==. {
scalar b19_included=0
}
}

if b19_included==1 {
drop age
gen age=b19_01
}
 
Read Message
Read Message
Previous Topic: sanitation service
Next Topic: chap 11(Nutrition indicator)
Goto Forum:
  


Current Time: Fri Nov 22 04:52:07 Coordinated Universal Time 2024