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]

Re: st: new variable column


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: new variable column
Date   Tue, 13 Sep 2011 18:42:33 +0100

Look at the -order- command.

. sysuse auto, clear
(1978 Automobile Data)

. gen newvar = 42

. ds
make          rep78         weight        displacement  newvar
price         headroom      length        gear_ratio
mpg           trunk         turn          foreign

. order make-trunk newvar

. ds
make          rep78         newvar        turn          foreign
price         headroom      weight        displacement
mpg           trunk         length        gear_ratio

Nick


On Tue, Sep 13, 2011 at 6:38 PM, Adler Scott A. <[email protected]> wrote:
> In stata12, is there way to add a variable column in between already existing variable columns, rather than just at the end of the dataset?  Or, alternatively, creating a new variable at the end of the dataset and then moving it to location within the dataset where you want it?

*
*   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