Statalist


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

Re: st: RE: identifying clusters with common elements


From   Dimitrije Tišma <[email protected]>
To   [email protected]
Subject   Re: st: RE: identifying clusters with common elements
Date   Mon, 18 Jan 2010 12:09:48 +0100

This would be more helpful if I was only interested in which
individuals move. But, I am rather interested in information on the
household level, i.e. do the households A and B share same members in
the longitudinal perspective? If this is the case, then my goal would
be to consider these two households one "artificial household". I am
thinking of some nice loop, but haven't been able to do it properly
because number of household members varies from one HH to another.
Thanks a lot in advance.





2010/1/17 Nick Cox <[email protected]>:
> 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/
>

*
*   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