Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: identifying clusters with common elements


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: identifying clusters with common elements
Date   Sun, 17 Jan 2010 17:22:01 -0000

It is fairly easy to identify which individuals have belonged to two or more households. 

That is 

bysort person (household) : 
	gen byte changed_hh = household[_N] != household[1] 

How do I list observations in a group that differ on a variable?
http://www.stata.com/support/faqs/data/diff.html

Then you can identify 

levelsof household if changed_hh 

That sounds like part of your problem. 

Nick 
[email protected] 

Dimitrije Tišma

I am doing a multilevel analysis in Stata (persons | households) but,
this being longitudinal data, some persons switch to other households
at some point, so some clusters (i.e. households) have common elements
(i.e. same id number belonging to different households in different
years). I was wondering what would be the most efficient way (loop?)
to identify whether two clusters have common elements. 

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



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