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/