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

st: RESHAPE HELP


From   BLEEDBANDW@aol.com
To   statalist@hsphsun2.harvard.edu
Subject   st: RESHAPE HELP
Date   Wed, 16 Oct 2002 18:43:01 EDT

Hi.  I am a new STATA user that is working on a secondary analysis for my 
dissertation research. I am trying to reconfigure a file that was set up with 
multiple record cases.  For example, a particular id# may be contained in 
this file numerous on the following variables: event # (gcount) and edate 
(month, day, year of the event). I am trying to convert the data from long 
form to wide form so that each id# is only represented in this file once and 
have run into some difficulty with the RESHAPE command. I know based upon 
what I have read in the Reference manual and the FAQ reshape information that 
I must need to create some additional variables because the j(edate variable) 
is not unique for each id #. Let me explain that the reason the edates are 
not unique is because an individual may have experienced mutiple events, such 
as a fall, on any given date.  I wondered if anyone might be able to point me 
in the right direction for how I should proceed with creating additional 
variables? I have included a condensed version of my syntax and output below.

Thanks in advance for your help,
Beth 

. reshape wide gcount, i(id) j(edate)
(note: j = 11928 11946 11956 11959.............)
edate not unique within id;
there are multiple observations at the same edate within id.
Type "reshape error" for a listing of the problem observations.
r(9);

reshape error

i (id) indicates the top-level grouping such as subject id.
j (edate) indicates the subgrouping such as time.
The data are in the long form;  j should be unique within i.

There are multiple observations on the same edate within id.

The following 253 out of 3741 observations have repeated edate values:

             id       edate
  75.        45  06/26/1994
  76.        45  06/26/1994
  92.        52  06/21/1994
  93.        52  06/21/1994

(data now sorted by id edate)
*
*   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