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 with summarizing data


From   Michael Stewart <michaelstewartresearch@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   st: need help with summarizing data
Date   Sun, 10 Feb 2013 14:54:42 -0500

Hi,
I am trying to find if there is a betterquicker way to do what I am doing

My data is as follows

id	name	dt	procedure
1	xxx	2000	eyesurgery
1	xxxx	2001	eyesurgery
1	xxxx	2002	hernia
1	xxxx	2009	hernia
2	yyy	2010	hernia
2	yyy	2011	cardiacsurgery
2	yyy	2012	eyesurgery
2	yyy	2012	eyesurgery

I am interested in making a excel file or  a stata dataset as follows for

id	name	eyesurgery_2000	eyesurgery_2001.......eyesyrgery2012
1	xxxx		1		1		0
2	yyyy		0		0		2

I use tabulate, copy it into excel file (use import wizard) and then
import into stata
Is there a quicker way??

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