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: RE: converting SAS file to stata using stat transfer-date and time variables


From   Leny Mathew <[email protected]>
To   [email protected]
Subject   Re: st: RE: converting SAS file to stata using stat transfer-date and time variables
Date   Wed, 22 Dec 2010 09:37:02 -0500

Thanks to all who posted comments regarding this question, especially
to Nick & Bill for explaining the intricacies of SAS/stata date and
time formats. I had a a few offers from statalisters who were willing
to check the file with newer versions of stat transfer. Dan Waldo
checked the file and was able to convert the file from SAS to stata
(using stat transfer 9) without any loss of information. On comparing
the time variable between the SAS and stata data sets, the stata time
variable is off by a second, but that is not an issue for me.
Circle systems replied that they do not support stat transfer 8 any
more, so I don't have any answers to offer.

Best wishes of the season to all!

Leny




On Tue, Dec 21, 2010 at 11:42 AM, Nick Cox <[email protected]> wrote:
> Approaching this from a different angle:
>
> Advising on exactly what happens when you want to transfer from A to D using B and/or C (here SAS, Stata, Stat/Transfer and MS Excel) would seem to require
>
> 1. expertise on A, B, C and D (not many of us qualify)
>
> 2. exact details of precisely what was done (for example, I don't know what precisely "conversion to excel" means).
>
> The conversion to Stata dates is often made even difficult to understand because, even though the facts are explained in the documentation,
>
> (a) dates are not a distinct type (meaning storage type) in Stata; they are just held as some kind of integer type, but that doesn't define them as dates
>
> (b) dates are intelligible as such within Stata given appropriate formats and manipulation using appropriate functions, but neither has anything much to do with the way that other software sees the same data
>
> (c) there's a prevailing misimpression that formats define storage or how data are held, but they define only how data are displayed.
>
> To be fair, the meaning of "type", "format", etc. varies between software, and the subtle differences can be just as puzzling as the stark differences.
>
> Just to cheer people up at what is for many a holiday time,
>
> Nick
> [email protected]
>
> Anders Alexandersson
>
> Leny, what is weird? Nick (and others, including Bill Gould) gave you
> a reasonable explanation to the problem and useful advice.
> Stat/Transfer does not support conversions between any of the numeric
> types, dates, or strings.
> I guess this is why the conversion results surprised you.
> You are using an old version of Stat/Transfer. Some people might think
> that is weird.
> If you need more help, please provide log files.
>
> Leny Mathew
>
>> Thanks Nick. It's weird considering that the conversion to excel works
>> fine. I can convert it as a csv file and then get it into stata
>> without any issue.
>
> Nick Cox
>
>>> I wouldn't assume much in this territory. Dates and times seem simple in principle but can be very awkward in practice.
>>>
>>> On this information, my only guess is that time (presumably time of day, up to 24hr) is being converted to fraction of a day. You need to look really closely at the data in SAS and in Stata.
>
> Leny Mathew
>
>>> I'm trying to convert a SAS file (V 9.1) with date and time variables
>>> (separate) into stata and I'm using stat transfer (version 8) for
>>> this. During the conversion, the date variable comes across fine, but
>>> all the time variable values are between 0 and 1. stat transfer reads
>>> the SAS file without any problem, it looks fine in the viewer and it
>>> converts into excel without any problem. I didn't have to format the
>>> date variable within stata, so I'm assuming that I don't have to do
>>> any formatting for the time variable either. Has anyone had this issue
>>> before?
>>>  Any comments are much appreciated. I'm using stata 10.1
>
> *
> *   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/
>

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