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: RE: RE: Saving variable order to dofile


From   Phil Clayton <philclayton@internode.on.net>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: RE: Saving variable order to dofile
Date   Thu, 29 Nov 2012 09:42:14 +1030

You can also use the -ds- command, for example:

sysuse auto, clear
order foreign weight length 
ds // display list of variables and return the list in r(varlist)
local order `r(varlist)' // store the list in local macro order

* now re-open the dataset and reproduce the order we created earlier
sysuse auto, clear
order `order'

Phil

On 29/11/2012, at 9:33 AM, "Dudekula, Anwar" <dudekulaan@upmc.edu> wrote:

> Thank you Ben 
> 
> Yours Sincerely,
> Anwar 
> ________________________________________
> From: owner-statalist@hsphsun2.harvard.edu [owner-statalist@hsphsun2.harvard.edu] on behalf of Ben Hoen [bhoen@lbl.gov]
> Sent: Wednesday, November 28, 2012 5:51 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: RE: Saving variable order  to dofile
> 
> One easy way would be to use variable manager to select all and copy names
> to a var list.  See e.g.,
> http://www.stata.com/capabilities/overview/variables-manager/
> 
> Then you could past the names after . order
> 
> See . help order
> 
> Ben
> 
> Ben Hoen
> LBNL
> Office: 845-758-1896
> Cell: 718-812-7589
> 
> 
> -----Original Message-----
> From: owner-statalist@hsphsun2.harvard.edu
> [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Dudekula, Anwar
> Sent: Wednesday, November 28, 2012 5:36 PM
> To: statalist@hsphsun2.harvard.edu
> Subject: st: Saving variable order to dofile
> 
> Hi ,
> I  am working with a large dataset with multiple variables and in the midst
> of analysis.I have aranged variables in specific manner . Is there a way to
> copy present order of variables to dofile without having to save the stata
> datafiles as I dont want to loose data Thanks a lot for your time
> Yours Sincerely,
> Anwar
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
> 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index