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


From   "Paul O'Brien" <[email protected]>
To   statalist <[email protected]>
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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index