Stata Package opendf

The opendf package is specifically designed to facilitate the seamless utilization of the Open Data Format in Stata. It offers functionality to import data from the Open Data Format into a Stata data frame, as well as export data from a Stata data frame (.dta) to the Open Data Format. Additionally, you can easily access comprehensive information about the dataset and variables. This user-friendly approach ensures convenient exploration and utilization of dataset information within your preferred environment.


Installation

The Stata package can be installed from SSC using the command ssc install.

* Install the package from ssc:
ssc install opendf

Alternatively the development version can be installed from GitHub.

* Install the development version from GitHub:
net install opendf, from (https://opendataformat.github.io/stata-package-opendf/) replace


Getting Started

The opendataformat package consists of three main functions:

* You can load a dataset in opendf-format with opendf_read by specifying the path to the zip-folder, (in this case, the testdataset from github):
opendf read "https://opendataformat.github.io/stata-package-opendf/example_data/soep_data.zip", clear verbose


Additional Functions

The opendataformat package provides further functions that might be helpful:

For data providers the opendf_csv2dta and opendf_csv2dta functions might be interesting to convert their data to the opendf format.


Multilingual Datasets

When working with a multilingual dataset, the opendataformat package provides the option to specify the language you want to work with for the main functions: opendf read, opendf docu, opendf write.

You can achieve this by using the languages argument and setting it to either all to include all languages, or by specifying the language code such as de for German or en for English. This allows you to easily select the desired language for your dataset operations. Metadata without a language tag will be assigned to the language default. The language codes are defined by the ISO 639-1.


Further Information

For more comprehensive insights into the Open Data Format specification, read the Open Data Format Specification. This resource provides detailed documentation and profiles illustrating the storage locations of attributes within the Open Data Format, as well as within the native formats to which they will be converted.

Additionally, you can download a practical example of a data file in the Open Data Format (example_dataset.zip).


Getting Help

If you encounter a clear bug, please file a minimal reproducible example on github.