The DHS Program User Forum
Discussions regarding The DHS Program data and results
Home » Countries » Ethiopia » Dropping mothers' records without dropping the child's
Re: Dropping mothers' records without dropping the child's [message #9096 is a reply to message #9073] Wed, 10 February 2016 15:22 Go to previous messageGo to previous message
Reduced-For(u)m
Messages: 292
Registered: March 2013
Senior Member


"Drop" in your code will drop observations, not variables. Instead, you could just replace the value of the maternal variable you don't want with "." instead of dropping the observation.

Note: be careful with your summary stats/analysis after this, because in some cases it will average over all the observations, and sometimes it will ignore the observations with missing variables, and you could accidentally end up comparing different samples in different places. See the Stata documentation for how to deal with that.


Note note: looking at your explanation, I'm not exactly sure what you want. You want mom's with only 1 kid to have height measures, and no height measures for the other moms, but you still want their kids in the sample? Why?
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Women's status module
Next Topic: How to identify ANC and Instuitional Delivery variables from the 2011 Ethiopian DHS?
Goto Forum:
  


Current Time: Thu Mar 28 17:03:12 Coordinated Universal Time 2024