Statalist


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

st: RE: Intervals time


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: Intervals time
Date   Tue, 22 Apr 2008 12:15:18 +0100

I am not quite clear what the question is here, but this may help: 

SJ-7-3  pr0033  . . . . . . . . . . . . . .  Stata tip 51: Events in
intervals
        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N.
J. Cox
        Q3/07   SJ 7(3):440--443                                 (no
commands)
        tip for counting or summarizing irregularly spaced
        events in intervals

See also -disjoint- and -spellutil- on SSC. 

Nick
[email protected] 

[email protected]

My data deals with subjects who receive 1, 2 or more treatements over
time.
We want to know how many time they spent with 1 treatment, 2 treatments,
3
treatments , ...

Data are as follows:

id	   begin	      end	   treat
1	04 Apr 2006	  06 Apr 2006	1
1	05 Apr 2006	  09 Apr 2006	0
1	08 Apr 2006	  12 Apr 2006	1
2	15 May 2006	  16 May 2006	1
2	16 May 2006	  24 May 2006	1
2	16 May 2006	  17 May 2006	1 

How can I calculate time spent with 1 treat for id=1, time spent with 2
treat
for id=1, ...

Maybe with after data has been stset ? 

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