[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
RE: st: reshape
This will not work without modification.
-ds- leaves behind a varlist in memory as r(varlist).
So Ada is correct that it may be useful for this
purpose. Indeed, this is in large part what -ds-
was designed to do.
However, -reshape- takes a stublist, not a varlist.
You must process that varlist before calling up -reshape-.
The FAQ I quoted earlier in this thread is relevant
> if you have more variables you want to reshape (X_ Y_ Z_) then those
> you don't want to reshape (id time), then you can specify:
> ds id time, not
> Now a list of all variables would be saved in `r(varlist)',
> then you can write:
> reshape long `r(varlist)' , i(id) j(time)
> On 5/12/06, Hans J. Baumgartner <email@example.com> wrote:
> > Dear statalist,
> > I would like to reshape quite a huge number of variables.
> Is it possible
> > to use the reshape command without specifying each single
> variable? Or can
> > I circumnavigate this problem creating a local that
> contains all variables
> > in the data set so that I can implement the local in the
> reshape command?
> > What I am having looks something like this:
> > Varnames : X_1 Y_1 Z_1 X_2 Y_2 Z_2
> > reshape long X_ Y_ Z_ , i(id) j(time)
> > How can I use the command without specifying X_ Y_ Z_ ?
* For searches and help try: