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 #11638 is a reply to message #11636] Fri, 20 January 2017 04:11 Go to previous messageGo to previous message
nwegbus is currently offline  nwegbus
Messages: 15
Registered: December 2015
Member
Thank you Tom. I knew I must have been doing something (or possibly many things) wrong.

So what I'm trying to do is figure out the total number of children each woman has. DHS (Nigeria) 2013 does not have this as a variable in the dataset, so what I decided to do was to combine 4 different variables (v202, v203, v204 and v205, i.e., sons at home, daughters at home, sons elsewhere and daughters elsewhere) to get total number of children per woman.

With regard to applying parentheses, (using just one line as an example) what it would look like is this:

replace achild=9 if (v202==9 & v203==0 & v204==0 & v205==0)| (v202==8 & v203==1 & v204==0 & v205==0)|

Thank you once again for your help and continued patience with me. It is much appreciated.

Som
 
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 02:35:15 Coordinated Universal Time 2024