Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: using reshape


From   "Svend Juul" <[email protected]>
To   <[email protected]>
Subject   Re: st: using reshape
Date   Mon, 11 Sep 2006 23:52:43 +0200

Mike Frone wrote:

I obtained data in this form:
respnum_  injnum   finalwt2  gender  ir1  ir2  ir3_  ir4_1_
354            1  16151.351    male  yes    2    no      no
354            2  16151.351    male  yes    2   yes      no
354            3  16151.351    male  yes    2     .       .
354            4  16151.351    male  yes    2     .       .
354            5  16151.351    male  yes    2     .       .
 
However, because this person only experienced 2 injuries, I wanted the 
data in this form:
respnum_  injnum   finalwt2  gender  ir1  ir2   ir3_  ir4_1_
354            1  16151.351    male  yes    2     no      no
354            2  16151.351    male  yes    2    yes      no
How can I keep the number of records for a given respondent equal to the 
number of injuries experienced?
----------------------------------------------------
 
Assuming that ir3_ and ir4_1_ are 0/1 numeric variables, no/yes being the 
value labels:
 
   drop if ir3==0 & ir4_1_==0
 
Hope this helps
Svend
 
________________________________________________________ 
 
Svend Juul
Institut for Folkesundhed, Afdeling for Epidemiologi
(Institute of Public Health, Department of Epidemiology)
Vennelyst Boulevard 6 
DK-8000 Aarhus C,  Denmark 
Phone, work:  +45 8942 6090 
Phone, home:  +45 8693 7796 
Fax:          +45 8613 1580 
E-mail:       [email protected] 
_________________________________________________________ 

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