https://github.com/tpapp/statadtafiles.jl
read and write Stata DTA files from Julia
https://github.com/tpapp/statadtafiles.jl
Last synced: over 1 year ago
JSON representation
read and write Stata DTA files from Julia
- Host: GitHub
- URL: https://github.com/tpapp/statadtafiles.jl
- Owner: tpapp
- License: other
- Created: 2018-09-17T12:45:26.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-12-20T09:19:41.000Z (over 5 years ago)
- Last Synced: 2025-02-28T16:20:13.780Z (over 1 year ago)
- Language: Julia
- Size: 30.3 KB
- Stars: 4
- Watchers: 4
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# StataDTAFiles

[](https://travis-ci.org/tpapp/StataDTAFiles.jl)
[](https://coveralls.io/github/tpapp/StataDTAFiles.jl?branch=master)
[](http://codecov.io/github/tpapp/StataDTAFiles.jl?branch=master)
Read DTA files from Stata.
This package provides low-level functions for reading (and in the future, writing) the DTA format that Stata uses for data files, written in native Julia, with no external dependencies.
You can use this package directly, or as a *basis for implementing high-level routines* that read to `DataFrame`s, etc.
## Usage
The primary entry point/recommended usage is is
```julia
open(DTAFile, ...) do dta
...
end
```
where the method for `open` would open the DTA file, read some metadata (byte order, layout, etc), and provide an iterator for the rows.
Date conversion is provided by `elapsed_days`.
See the unit tests for examples.
## Caveats
- work in progress, API is subject to change,
- variable-length strings (`StrL`) not yet supported,
- currently format 118 is supported, 119 is planned,
- test coverage is incomplete,
- some metadata reading is WIP.
## Documentation of Stata DTA format
- [Stata 15 help](https://www.stata.com/help.cgi?dta)
- [Library of Congress on *Stata Data Format (`.dta`), Version 118*](https://www.loc.gov/preservation/digital/formats/fdd/fdd000471.shtml)