|
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: how to retain a complicated subset of data
try using -reshape- making it "wide" on the hhid, then drop households where child==0 or .
________________________________________
From: [email protected] [[email protected]] On Behalf Of Maghais SK [[email protected]]
Sent: Friday, June 27, 2008 4:32 PM
To: [email protected]
Subject: st: how to retain a complicated subset of data
Hello
I have a dataset on households of parents with kids, and parents without kids. I only want to keep the data of parents and their kids. For instance in the example below, I wish to keep only the first household(parents with 2 kids) and drop the other households. Is there any easy way of doing this? The keep and drop command works for individual observations. But I need to keep all the household members if the household has kids. Thank you
HHID Number in household
001 1 (father)
001 2 (mother)
001 3 (child)
001 3 (child)
002 1 (father)
002 2 (mother)
003 1 (father)
004 2 (mother)
-Mag
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/