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

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


From   [email protected]
To   [email protected]
Subject   st: Re-defining a variable's type but keeping it "in place"
Date   Thu, 09 Dec 2004 18:21:54 -0500

Hi

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?

Many thanks.

Regards

Joseph


__________________________________________________________________
Switch to Netscape Internet Service.
As low as $9.95 a month -- Sign up today at http://isp.netscape.com/register

Netscape. Just the Net You Need.

New! Netscape Toolbar for Internet Explorer
Search from anywhere on the Web and block those annoying pop-ups.
Download now at http://channels.netscape.com/ns/search/install.jsp
*
*   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