Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

st:reshape command ---listing all the variables changing over time?


From   Amanda Fu <[email protected]>
To   [email protected]
Subject   st:reshape command ---listing all the variables changing over time?
Date   Thu, 13 May 2010 15:56:57 -0400

Hi all,

I was wondering if anyone could help me with a problem I met when
using --reshape--command.

When I tried to reshape a data set from long version to wide version,
I find I  need to list all the variables that are not constant in the
--reshape--command. Suppose the data set has 1500 variables changing
over time and 100 constant variables.
------------------------------------------------------------
. reshape wide x1-x1500, i(id) j(wave)
------------------------------------------------------------
If I miss any of the variables changing over time, the reshape command
will give error message such as "variable XXXX not constant " and will
stop working.  But it is so frustrating to separate the constant
variables and not-constant variables and list all of the latter ones
in the reshape command.

What I used to do is just to drop all the unnecessary variables from
the data set before reshape to reduce the work load here.

May I know if there is any more efficient way to deal with this problem?

Thanks for your time!

Sincerely,
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/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index