[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
st: RE: [Fwd: gen a between houshold id]
See if this helps:
> -----Original Message-----
> From: email@example.com
> [mailto:firstname.lastname@example.org]On Behalf Of Hans J.
> Sent: 24 March 2004 16:09
> To: statalist
> Subject: st: [Fwd: gen a between houshold id]
> Dear Statalist,
> Can anybody help me to generate a new variable that indicates the
> household of the parents. To clarify my data:
> persnr sex V05001 vnr v_hh
> 1 m 1 . .
> 2 f 1 . .
> 3 f 1 1 1
> 4 f 11 1 1
> persnr is a person identifier (1 = the father, 2 = the
> mother, 3 = the
> daughter that lives with the parents and 4 = the daughter
> that lives in
> another household).
> vnr identifies the persnr of the father.
> I would like to generate a new variable v_hh that identifies the
> houshold id (V05001) of the father. It is easy for the daughter that
> lives with her parents but I find it quite difficult to generate the
> between household link with the daughter that does not live with her
> I thus constructed a loop that is copy/pasted below. However,
> I do have
> 21,000 obs. and I do have to run the loop twice, i.e. for
> both parents,
> which takes more than 3 hours.
> Can anybody help me to generat faster between household links?
> And to make thinks even more complicated. I have more than two
> generations in my data, that is, motherid and fatherid does not
> necessarily be missing.
> I appreciate all comments.
* For searches and help try: