Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: [-reshape- and -expand- question]


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   st: RE: [-reshape- and -expand- question]
Date   Thu, 14 Apr 2005 15:13:00 +0100

Let's suppose your variables are 

ICU A AB B 

You need to -reshape- and then -expand-. 

drop A  
rename AB vAB
rename B  vB 
reshape long v , i(ICU) string 
expand v 

See help on -reshape- and -expand-. 

Nick 
[email protected] 

Simone Piva, MD 

> I Have this data:
> 
> 	A                               B                       
>           A-B
> ICU1	100		10		    90
> ICU2	....		...		     ....
> ICU3
> 
> 
> Where A= total patients for ICU number 1
> B= patients that received late tracheostomy
> A-B=  total patients- patients that received late tracheostomy
> 
> In this form I can't analyze my data; I need data in this form:
> 
> 	B	A-B
> ICU1   	1	0
> ICU1	1	0
> ICU1	1	0
> ICU1	1	0
> ICU1	1	0
> ICU1	1	0
> ICU1	1	0
> ICU1	1	0
> ICU1	1	0
> ICU1	1	0
> ICU1	0	1
> ICU1	0	1
> ....  Repeat for 100

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index