Statalist


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

Re: st: "revise" variables in varlist after --reshape--


From   Richard Ochmann <rochmann@diw.de>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: "revise" variables in varlist after --reshape--
Date   Wed, 18 Mar 2009 17:36:13 +0100

you could take your "original wide data set", do
----------
. reshape long var4-var5, i(id) j(year)
----------
and -merge- the resulting data set to your current long-format data set 
containing var1-var3.

best, rich



Mandy fu <mandy.fu1@gmail.com> 
Gesendet von: owner-statalist@hsphsun2.harvard.edu
18.03.2009 17:17
Bitte antworten an
statalist@hsphsun2.harvard.edu


An
statalist@hsphsun2.harvard.edu
Kopie

Thema
st: "revise" variables in varlist after --reshape--






Hi all,

After reshape the data from wide into long, I find I forgot to include
some variables in the varlist in the --reshape long--command.
The following command is what I used:
----------
. reshape long var1-var3, i(id) j(year)
----------
Then I realized I should include two more variables:
--------
.. reshape long var1-var5, i(id) j(year)
--------
To fix this problem, I know I could go back to the original wide data
set and reshape again from the very beginning adding the variables I
forgot . But if I have done a lot of steps on the reshaped long data
already, this method means I have to redo all  those again.  I wonder
if there' s any better way to "revise" the reshape command in this
situation.

Thanks in advance!
Mandy
*
*   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