DTALib.jl

Read Stata '.dta' files in Julia
Author MUsmanZahid
Popularity
0 Stars
Updated Last
10 Months Ago
Started In
December 2019

Build Status

This package provides support for Stata '.dta' files from Stata verison 8 and above.

Quickstart

using Pkg
Pkg.add("DTALib.jl")

using DTALib
data = DTALib.read("<your_stata_dataset>.dta")

The read function returns a DTA structure which includes two fields: 1. the Header, and 2. the Data.

Continuing with the previous example. The Header can be separately accessed from the 'data' variable by the dot syntax, i.e.

data.Header

Similarly the Data can be accessed by

data.Data

Features

Currently supports:

  • Reading .dta files. Specifically it supports dta versions:
    • 113: Stata 8
    • 114: Stata 10
    • 115: Stata 12
    • 117: Stata 13
    • 118: Stata 14, 15, and 16
    • 119: Stata 15 and 16 (when dataset has more than 32,767 variables)
  • Reading Header information including:
    • the Dataset Label
    • the Dataset Timestamp
  • Missing values

There are plans to support:

  • Writing to .dta files
  • Very long strings, specifically, strings longer than 2,045 bytes, aka strL's in Stata's terms
  • Variable labels: i.e. no labelling for binary (0,1) or categorical encoded variables (0, 1, 2, ...)

Used By Packages

No packages found.