Read Stata 13 file in R
r, stata
Solution
If you have Stata 13, then you can load it there and save it as a Stata 12 format using the command `saveold` (see `help saveold`). Afterwards, take it to R.
If you have, Stata 10 - 12, you can use the user-written command `use13`, (by Sergiy Radyakin) to load it and save it there; then to R. You can install `use13` running `ssc install use13`.
Details can be found at http://radyakin.org/transfer/use13/use13.htm
Other alternatives, still with Stata, involve exporting the Stata format to something else that R will read, e.g. text-based files. See `help export` within Stata.
Update
Starting Stata 14, `saveold` has a `version()` option, allowing one to save in Stata .dta formats as old as Stata 11.
Problem
Is there a way to read a Stata version 13 dataset file in R? I have tried to do the following: ``` > library(foreign) > data = read.dta("TEAdataSTATA.dta") ``` However, I got an error: Error in read.dta("TEAdataSTATA.dta") : not a Stata version 5-12 .dta file Could someone point out if there is a way to fix this?