Skip to content

tpapp/StataDTAFiles.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

StataDTAFiles

Lifecycle Build Status Coverage Status codecov.io

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 DataFrames, etc.

Usage

The primary entry point/recommended usage is is

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