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: RE: Restructuring of data


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Restructuring of data
Date   Wed, 26 Jan 2011 19:40:53 +0000

Look at the help for -reshape-. If I understand you correctly you want to -reshape long-. You need an identifier: it looks like pin_anonym. 

Nick 
n.j.cox@durham.ac.uk 


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Mats Martinell
Sent: 26 January 2011 19:32
To: statalist@hsphsun2.harvard.edu
Subject: st: Restructuring of data

Dear Statalist,
In swedish healthcare we are compensated by diagnose of the patient  
treated. The the economic compensation is different if the diagnose is  
primary, secondary, tertiary an so forth. I want to study the  
incidence of certain diagnoses and for that purpose I need to  
restructure "diagose1, diagnose2, diagnose3 and diagnose4" into one  
variable (see below). The catch is that I would like to only have one  
diagnose per row without changing the other variables (i.e. more rows  
need to bee created).  All help is highly appreciated!
	
variable name		type	format		
					
date				int	%8.0g		
source				str3	%9s		
pin_anonym			int   %8.0g		
medenh				str20 %20s		
medreg				str20%20s		
antalbesk			int	%8.0g		
diagnose1			str5	%9s		
diagnose2			str8	%9s		
diagnose3			str8	%9s		
diagnose4			str6	%9s		     		
sex					byte	%8.0g		
birth_year			int	%ty		
incl_year			int	%ty		
death_year			int	%ty		
incl_date			float	%td..		
death_date			float	%td..		

Mats Martinell, Ph.D. student
Dept of Public Health and Caring Sciences
Uppsala university






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

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