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" <>
To   <>
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,

> -----Original Message-----
> From: [mailto:owner-
>] On Behalf Of
> Sent: Tuesday, August 17, 2004 6:57 PM
> To:
> 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


*   For searches and help try:

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