[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]
Re: st: collapse _all by
Fred Wolfe wrote
> At 05:50 PM 9/22/2002 -0700, you wrote:
> >I want to collapse a large number of variables by tract, i.e.
> >. collapse (sum) _all, by(tract)
> >Naturally, stata complains that tract is included in _all:
> >tract may not be both target and by()
> >Any clever way around that?
> Check out -order- to move tract to the front. The collapse var2-varlast,
Another way is
.. unab all: _all
.. local allx: subinstr local all "touse" " ", all
.. collapse (sum) `allx', by(tract)
* For searches and help try: