Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Date: Sat, 7 Dec 2002 15:35:59 +0100


From   "Sophie Barthel" <[email protected]>
To   <[email protected]>
Subject   st: Date: Sat, 7 Dec 2002 15:35:59 +0100
Date   Sat, 7 Dec 2002 10:35:44 -0500 (EST)

i have currently got a variable which can take the values 1 or 0. i want to
create a new variable which takes the values of the old one but which will
be equal to 0 once the number of 0 values in the old variable exceeds 200.

the code i have used is

generate y = progid
recode y = 0 if ( _(progid==0)>200)

is that correct?

the reason is that i am doing a survival study where i want to recode the
observations as censored once 200 failures have occurred.


*
*   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/



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