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: Reshape to wide but to particular variables


From   "Paul O'Brien" <paul.obrien@afe2.org.uk>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: Reshape to wide but to particular variables
Date   Sat, 21 Apr 2012 10:08:23 +0100

I have a database of clinical activity that I want to reshape to wide but to particular variables, but so far have failed.

Date	id	clinic	activity					
01.01.01	1	RC	A					
01.01.01	1	RC	B					
01.01.01	1	RC	D					
02.01.01	1	RC	A					
02.01.01	1	RC	C					
02.01.01	1	RC	E					
02.01.01	1	RC	F					
01.01.01	2	MR	A					
01.01.01	2	MR	C					
01.01.01	2	MR	D					
01.01.01	2	MR	F	

And what I want is:
				
Date	id	clinic	AorBorC1	AorBorC2	AorBorC3	DorEorF1	DorEorF2	DorEorF3
01.01.01	1	RC	A	B		D		
02.01.01	1	RC	A	C		E	F	
01.01.01	2	MR	A	C		D	F	

Thanks,

Paul



					


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index