Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


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

st: Need help sorting values


From   Michael Stewart <michaelstewartresearch@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Need help sorting values
Date   Sun, 17 Feb 2013 10:32:15 -0500

Hi ,

I have data for different as follows

pateint	  date		report
111	2/15/2012	ed
111	2/15/2012	ed
111	2/15/2012	h&p
111	2/15/2012	d/c
111	2/15/2012	ed
111	2/15/2012	con
111	1/23/2012	con
111	1/23/2012	d/c
111	1/23/2012	ed
111	1/23/2012	con
111	1/23/2012	h&p
222   1/20/2012  ed
222    1/20/2012  h&p
222  1/20/2012   con

My need is to sort the report variable for a particular date within a
patient so that the h&p is the first value and ed is the last value
i.e h&p is report[1] and ed is report[_N]


something like bysort patient date: _ _ _ _ _

Thanks
Mike

-- 
Thank you ,
Yours Sincerely,
Mike.
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index