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

st: RE: Generating a New Variable


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Generating a New Variable
Date   Wed, 11 May 2005 20:13:21 +0100

Assuming -tsset- data, e.g. 

tsset id time 

then this sounds like 

gem QUIT = L.Participation == 1 

Nick 
[email protected] 

SULE OCHAI
 
> I need some help. I have a longitudinal dataset that I'm 
> using for survival
> analysis. In the dataset, I have a variable called 
> Participation (yes=1 & 0
> otherwise). Now I want to create a new variable called "Quit" 
> or "Exit". To
> create the new variable, my idea is that if an individual 
> records "1" in year
> t, I want him to move out of the risk set in year t+1. So, 
> the question is how
> do I go about creating the new variable I like to call QUIT!

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