Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: RE: Re-defining a variable's type but keeping it "in place"


From   "jockmcdock" <[email protected]>
To   [email protected]
Subject   Re: st: RE: Re-defining a variable's type but keeping it "in place"
Date   Fri, 10 Dec 2004 15:29:23 -0000

Nick

many thanks. That's exactly what I was looking for.

Joseph

--- In [email protected], "Nick Cox" <n.j.cox@d...> wrote:
> You could make use of -order-
> or -move-. 
> 
> order *1 *2
> 
> See help on -order-.  
> 
> Nick 
> n.j.cox@d... 
> 
> jockmcdock@n...
> > 
> > I have a tab-separated data set which contains a number of 
> > dates entered as strings. Converting the strings to dates is 
> > no problem using the 'date' function, but the new variable is 
> > added to the end of the data set. For example, if I have a 
> > data set that has the following variables
> > 
> > id stringdate1 info1 stringdate2 info2
> > 
> > (where the stringdates are dates encoded as strings) and I 
> > cast the strings into real dates (and delete the strings), I 
> > end up with a data set that looks like
> > 
> > id info1 info2 realdate1 realdate2
> > 
> > Not a problem for a data set with five columns, but real data 
> > sets are much broader. In any case, it would be nice to keep 
> > all the '1' data items together etc.
> > 
> > Can I convert data 'in place' or move columns back to their 
> > 'original' positions?
> > 
> 
> *
> *   For searches and help try:
> *   http://www.stata.com/support/faqs/res/findit.html
> *   http://www.stata.com/support/statalist/faq
> *   http://www.ats.ucla.edu/stat/stata/



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index