Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


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

Re: st: new variable column


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
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. <adler@yorku.ca> 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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index