The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Tanzania » Creating year dummy for TDHS for 2010, 2004 and 1996
Re: Creating year dummy for TDHS for 2010, 2004 and 1996 [message #4294 is a reply to message #4252] Fri, 01 May 2015 12:16 Go to previous message
Trevor-DHS is currently offline  Trevor-DHS
Messages: 805
Registered: January 2013
Senior Member
For each of the datasets individually (before you pool them), just use something like:
gen year=1996

Alternatively after pooling you can use:
gen year = 0
replace year = 1996 if v007 = 96
replace year = 2004 if v007 = 2004 | v007 = 2005
replace year = 2010 if v007 = 2009 | v007 = 2010

and then check if any are not set by doing
tab v007 year

 
Read Message
Read Message
Previous Topic: How to compute child mortality of different ages
Next Topic: Variable for children education/ enrollment ratio/grade attainment
Goto Forum:
  


Current Time: Sat Mar 1 16:28:56 Coordinated Universal Time 2025