Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: Reshape question


From   "Kieran McCaul" <Kieran.McCaul@uwa.edu.au>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Reshape question
Date   Mon, 14 Sep 2009 14:05:22 +0800

...

Try:
help xpose


______________________________________________
Kieran McCaul MPH PhD
WA Centre for Health & Ageing (M573)
University of Western Australia
Level 6, Ainslie House
48 Murray St
Perth 6000
Phone: (08) 9224-2701
Fax: (08) 9224 8009
email: Kieran.McCaul@uwa.edu.au
http://myprofile.cos.com/mccaul 
http://www.researcherid.com/rid/B-8751-2008
______________________________________________
If you live to be one hundred, you've got it made.
Very few people die past that age - George Burns

-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu
[mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Si Yue Li
Sent: Monday, 14 September 2009 12:27 PM
To: statalist@hsphsun2.harvard.edu
Subject: st: Reshape question

Dear Statalist Users,

as a beginner, I am having some trouble importing large excel datatables

containing datastream output into stata long format. I checked with 
faq/help files and think that the reshape command combined with some 
data manipulations must be the answer. Right now I can get the data to 
look like this in Stata:
|v1|v2|v3|v4|v5|...    
|.|ID code1|ID code2|ID code3|ID code4|...         
|date1| Xij|Xij|Xij|Xij|...
|date2| Xij|Xij|Xij|Xij|...
|...|...|...|...|...

where Xij = Data

However from my past Stata experiences the usual long form is much 
better to work with:

|ID code1|date1|Xij|
|ID code1|date2|Xij|
|...|...|...|
|ID code2|date1|Xij|
|ID code2|date2|Xij|
|...|...|...|

I think reshape will solve this for me, but I couldn't get anything to 
work...
Please offer advice, thank you.

Si Yue



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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