Tessa,
I need to add sth!
/* generating a variable holding the date from the appointment with
def_inrange==1. This won't work for groups where def_inrange takes
a missing value.
Added: an if-condition to make sure that the command does not produce
wrong results for groups with all def_inranges==0!
*/
bysort donor_id (def_inrange): gen test=date[_N] if def_inrange[_N]==1
Sebastian
*
* 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/