bysort hhid: gen num = _N
drop if num == 1
drop num
where, in this case, _N is the number of observations for each group (for
more helpful advice see Nick Cox's "Speaking Stata: How to move step by:
step" Stata Journal (2)1 )
Hope this helps,
Scott
> -----Original Message-----
> From: [email protected] [mailto:owner-
> [email protected]] On Behalf Of [email protected]
> Sent: Tuesday, August 17, 2004 6:57 PM
> To: [email protected]
> Subject: st: making a matched data set
>
> Dear all,
> I want to make a matched-couple data set. All respondents are married in
> this
> data set. What I want to know is how to drop non-matched case like the
> following first household (hhid=0000045). or keep matched-couple cases.
> At first I thought I can use "merge" command after separating husbands
> from
> wives, but it seems that's not true. Would you give me some suggestions?
> or
> where can I find out some information about that? I couldn't find it.
>
> Thanks,
> Hae-Bong
>
<snip>
*
* 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/