Statalist


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

RE: st: add up the total stay


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: add up the total stay
Date   Sun, 14 Oct 2007 21:37:20 +0100

I've already suggested -egen, total()-
as a way of doing this. Why not try it 
or explain why it is not what you want? 

Nick 
[email protected] 

Dndee (plus three other posts) 
 
> I need expression and commands to tell STATA;
> If "id" is the same as previous observation and if
> "in"  for this observation equals to "out" in previous
> one, then add " stay" to previous one to calculate
> StayEachVisit.  And consider that number of
> observations for total stay in each visit is not
> defined (in the example it is 1-2 but it can be one
> 1-7 or more).

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