As you know, Stata support in 'foreign' was frozen a while back at Stata version 12. R-core has received a request from a grad student to 'give top priority' to supporting Stata 13. That is not going to happen, not least because none of us has access to Stata. However, according to Stata's documentation both Stata 12 and 13 use format 115, so foreign::read.dta should be able to read Stata 13 files. It would be helpful to know if that is the case. Second, Stata document reading R's POSIXct date-times into Stata at http://www.stata.com/manuals13/ddatetime.pdf page 10 using format %tC. The description there of 'UTC-adusted seconds' is ambiguous, but what is said on page 2 suggests %tc is correct. Could someone please try reading a recent R date-time into Stata (one since July 2012, the last leap second) and see which format reads it correctly. Finally, PR#15517 is about undocumented details of a change in the way Stata saves dates. It would be helpful if someone could send me two example Stata 12/13 files, one containing a column of dates and one containing a column of date-times together with a printout of what Stata interprets them as. Thanks for any help, BDR -- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
On 23/01/2014 08:21, Prof Brian Ripley wrote:> As you know, Stata support in 'foreign' was frozen a while back at Stata > version 12. R-core has received a request from a grad student to 'give > top priority' to supporting Stata 13. That is not going to happen, not > least because none of us has access to Stata. > > However, according to Stata's documentation both Stata 12 and 13 use > format 115, so foreign::read.dta should be able to read Stata 13 files. > It would be helpful to know if that is the case. > > Second, Stata document reading R's POSIXct date-times into Stata at > http://www.stata.com/manuals13/ddatetime.pdf page 10 using format %tC. > The description there of 'UTC-adusted seconds' is ambiguous, but what is > said on page 2 suggests %tc is correct. Could someone please try > reading a recent R date-time into Stata (one since July 2012, the last > leap second) and see which format reads it correctly. > > Finally, PR#15517 is about undocumented details of a change in the way > Stata saves dates. It would be helpful if someone could send me two > example Stata 12/13 files, one containing a column of dates and one > containing a column of date-times together with a printout of what Stata > interprets them as.Thanks to George Vega Yon I have the Stata 12 files I need.> > Thanks for any help, > > BDR >-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595
FWIW, documentation .dta from Stata 13:: http://www.stata.com/help.cgi?dta "Stata 13 writes what are known as .dta format-117 files and can read all formats of files that have ever been released. The recent history of .dta formats is Format Current as of --------------------------------------- 117 Stata 13 116 internal; never released 115 Stata 12 114 Stata 10 113 Stata 8 --------------------------------------- Format 117 is documented below..." -- View this message in context: http://r.789695.n4.nabble.com/Stata-support-in-package-foreign-tp4684022p4685037.html Sent from the R devel mailing list archive at Nabble.com.
Maybe Matching Threads
- Help with write.foreign (exporting data to Stata)
- cluster option in stata for random intercept model in the R language?
- Re: Use of the Foreign package to import Stata files
- Possible bug in foreign library import of Stata datasets
- R: Use of the Foreign package to import Stata files