I assume that this reads
hhold 1 rd 1
hhold 1 rd 2
hhold 1 rd 2
hhold 1 rd 3
so that this example includes 4 observations.
It sounds as if you want
gen long obsno = _n
gen byte different = hhold != rd
bysort hhid (different obsno) : drop if _n == 1 & !different
sort obsno
-different- is 0 if -hhold- is equal to -rd- and 1 otherwise.
Nick
[email protected]
JEFFREY ROSEN
> I have a very basic question. The panel set that I am using
> is identified by hhold and rd. A few of the observations
> contains the same hhold and rd. For example:
>
> hhold 1
> rd 1
> hhold 1
> rd 2
> hhold 1
> rd 2
> hhold 1
> rd 3
>
> I would like to drop the first observation where the hhold
> and rd are identical. How do I do so?
*
* 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/