Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: creating an index variable: number of presentations to hospital by participant


From   Alison McCarthy <[email protected]>
To   stata <[email protected]>
Subject   st: creating an index variable: number of presentations to hospital by participant
Date   Tue, 14 Sep 2010 11:53:56 +1030

Dear statalist,
 
I am working with a large data file containing presentations to a hospital emergency department (ED). A number of individuals make more than one presentation, which I have seen via the command 'duplicate'. The organisation of my data is below: 
 
ARRIVALDATE    repeaters part_ID age DISCHARGEDATE
30-Mar-10       0          70     50   30-Mar-10 
30-Mar-10       0          70     50   30-Mar-10 
31-Mar-10       0          70     50   31-Mar-10 
01-Apr-10       0          70     50   01-Apr-10 
 

As can be seen, this person presented twice to the ED on the one day; the second person presenting twice in a two-day period.
 
I wish to create a new variable which tells me the number and order (in terms of date) of presentations for each participant, and would greatly appreciate some guidance.
 
Kind regards
  		 	   		  
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index