The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Data » Dataset use in Stata » Too long command in Stata?
Re: Too long command in Stata? [message #11663 is a reply to message #11638] Mon, 23 January 2017 06:23 Go to previous messageGo to previous message
Bridgette-DHS is currently offline  Bridgette-DHS
Messages: 3117
Registered: February 2013
Senior Member
Following is a response from Senior DHS Stata Specialist, Tom Pullum:


Apparently you do not know that arithmetic can be done within a recode statement. The number of children ever born is included in the data as v201. It is the sum of v202 through v207. If you want the number of LIVING children, you can calculate that in two ways, either with "gen nlch=v202+v203+v204+v205" or with "gen nlch=v201-(v206+v207)". Much simpler than what you were doing. Fortunately, this group of variables (v201 through v209) never has codes for "not applicable" or "don't know" or "missing", etc. If the component variables for a recode DO have such codes, you have to be sure to take them into account.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: stset for survival analysis for complex survey in IR files using Stata
Next Topic: Using community-level variables in regression models
Goto Forum:
  


Current Time: Sun Jul 28 04:24:27 Coordinated Universal Time 2024