Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: generating variable with previous values [was: RE: st: Wald test limit?]


From   "Unnati Rani Saha" <[email protected]>
To   <[email protected]>
Subject   RE: generating variable with previous values [was: RE: st: Wald test limit?]
Date   Wed, 6 Feb 2008 20:34:36 +0100

Thank you very much you, Nick. It works well. I am grateful to you.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Nick Cox
Sent: woensdag 6 februari 2008 18:53
To: [email protected]
Subject: generating variable with previous values [was: RE: st: Wald test
limit?]

Please read the FAQ on using informative titles, on not replying to 
other threads and on deleting irrelevant material. 

You don't say what your difficulty is. But perhaps this example will
help: 

. bysort mother_id (B_order) : gen prev_infd = infd[_n-1] 

Nick 
[email protected] 

Unnati Rani Saha

I am facing difficulties to compute a new variable. I would grateful if
any
of you help me. My data is in long file and I have given below an
example:

Mother's ID		Child's B_date	     B_order	Infant death
1S00005404		6-sep-82			1
1
1S00005404		6-jan-84			2
0
1S00005404		9-jan-87			3
1
1S00005404		14-dec-87			4
1
1S00005404		8-feb-90			5
0
1S00005404		17-jan-99			6
1





© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index