New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing stat file in old format (e.g. Stata 8) #217

Closed
larmarange opened this Issue Sep 12, 2016 · 3 comments

Comments

Projects
None yet
3 participants
@larmarange
Copy link
Contributor

larmarange commented Sep 12, 2016

Since the support of Stata 14, it seems that write_dta export data in Stata 14 format. The problem is that it's not possible to open the file with an older version of Stata and/or with other software that supports Stat format but usually only older version.

Therefore, would it be possible to have an option allowing to export a file to an older version of Stata?

@evanmiller

This comment has been minimized.

Copy link
Contributor

evanmiller commented Sep 12, 2016

@hadley this can be specified with readstat_writer_set_file_format_version(), passing in DTA version 105-118.

Sent from my iPhone

On Sep 12, 2016, at 13:29, Joseph notifications@github.com wrote:

Since the support of Stata 14, it seems that write_dta export data in Stata 14 format. The problem is that it's not possible to open the file with an older version of Stata and/or with other software that supports Stat format but usually only older version.

Therefore, would it be possible to have an option allowing to export a file to an older version of Stata?


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@hadley

This comment has been minimized.

Copy link
Member

hadley commented Sep 15, 2016

How do dta versions correspond to stata versions? (just subtract off 100?)

What's the most common version of stata? Should I default to stata 13?

@evanmiller

This comment has been minimized.

Copy link
Contributor

evanmiller commented Sep 16, 2016

There's not a simple correspondence. I can add some C constants but the DTA docs state:

   Format        Current as of
    ---------------------------------------
      118         Stata 14
      117         Stata 13 
      116         internal; never released
      115         Stata 12
      114         Stata 10
      113         Stata  8
    ---------------------------------------

ReadStat supports back to 105 which I think is Stata 4 or 5.

In ReadStat I default to Stata 14 because this has the best Unicode and long string support.

In Wizard I offer three options with this summary:

Stata 14 (released 2015): Full Unicode, strings up to 2045 bytes
Stata 13 (released 2013): No Unicode, strings up to 2045 bytes
Stata 10 (released 2007): No Unicode, strings up to 244 bytes

@hadley hadley closed this in b7f00cd Sep 16, 2016

@lock lock bot locked and limited conversation to collaborators Jun 26, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.