Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: making a matched data set


From   "Scott Merryman" <smerryman@kc.rr.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: making a matched data set
Date   Tue, 17 Aug 2004 20:03:35 -0500

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: owner-statalist@hsphsun2.harvard.edu [mailto:owner-
> statalist@hsphsun2.harvard.edu] On Behalf Of hbwoo@mail.utexas.edu
> Sent: Tuesday, August 17, 2004 6:57 PM
> To: statalist@hsphsun2.harvard.edu
> 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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index