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" <U.R.Saha@uvt.nl>
To   <statalist@hsphsun2.harvard.edu>
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: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Nick Cox
Sent: woensdag 6 februari 2008 18:53
To: statalist@hsphsun2.harvard.edu
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 
n.j.cox@durham.ac.uk 

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