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: Need help sorting values


From   Michael Stewart <[email protected]>
To   statalist <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index