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/