Statalist


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

st: Reshape question


From   Si Yue Li <[email protected]>
To   [email protected]
Subject   st: Reshape question
Date   Mon, 14 Sep 2009 06:36:18 +0200

Dear Statalist Users,

(Sorry for the double post, but the table in my last mail was badly 
formatted)

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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index