Statalist The Stata Listserver


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

Re: st: using reshape


From   frone@ria.buffalo.edu
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: using reshape
Date   Mon, 11 Sep 2006 18:05:22 -0400

Svend,

Thanks for your response.  Unfortunately, as I noted, this was a partial 
record for one case.  There are many other injury characteristics. 
Moreover, a respondent may have from 1 to 5 injury event, so the number of 
records within each value of respnum_ can range from 1 to 5.  So a simple 
drop is unlikely to resolve the problem.

Mike




"Svend Juul" <SJ@SOCI.AU.DK> 
Sent by: owner-statalist@hsphsun2.harvard.edu
09/11/2006 05:52 PM
Please respond to
statalist@hsphsun2.harvard.edu


To
<statalist@hsphsun2.harvard.edu>
cc

Subject
Re: st: using reshape






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:       sj@soci.au.dk 
_________________________________________________________ 

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


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index