rick,
if i understand you right & the data are already sorted in this way, then
type this command once:
replace hid = hid[_n-1] if hid==.
and it will fill in all the missing values.
chris
On Mon, 24 Mar 2003, 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/