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

Re: st: Replacing missing household-level id #'s for individual household members


From   Edwin Leuven <[email protected]>
To   [email protected]
Subject   Re: st: Replacing missing household-level id #'s for individual household members
Date   Mon, 24 Mar 2003 15:58:23 +0100

replace hid = hid[_n-1] if hid==.

On Mon Mar 24 2003 15:46, Rick Tardanico wrote:
> Greetings,
>
> In long format, I have data on 1000+ individual members (hmem) of 200
> households.  For each household, the household id variable (hid)
> includes an id-# for the first member only, as follows:
>
> hid hmem
> 1      1
> .       2
> .       3
> 2      1
> .       2
> 3      1
> .       2
> .       3
> .       4
> .       5
>
> For each household member (hmem), I need to replace the missing
> household  id-# (hid) with the corresponding id-#.  My attempts so far
> have failed.  Would someone be able to clue me in on where I'm going wrong?
>
> Thanks,
> Rick
>
> *
> *   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/

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



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index