help for opendf read (opendf_read) version 2.0.2 (28 August 2024)

opendf read -- builds a Stata dataset (.dta) from open data format dataset (.zip)

Syntax

opendf read input [,rowrange([start][:end]) colrange([start][:end]) clear save() replace verbose]

options

rowrange([start][:end]) Indicates the range of rows to read.

colrange([start][:end]) Indicates the range of columns to read.

clear Clears any existing datsaet in the memory.

save(string) Save data to desired filepath and filename.

replace Overwrite any existing file.

verbose More warnings are displayed.

Description

opendf read Loads data from ODF file (zip-folder) into Stata including metadata saved in labels and characteristics.

The dataset is stored in the format of the original dataset. Metadata is saved as labels or in the characteristics.

input path to zip file or name of zip file in working directory.

"rowrange([start][:end])" specifies a range of rows within the data to load (excluding the header). start and end are integer row numbers.

"colrange([start][:end])" specifies a range of variables within the data to load. start and end are integer column numbers.

clear specifies that it is okay to replace the data in memory, even though the current data have not been saved to disk.

replace overwrite existing reshaped competency dataset.

If option replace is specified, a former saved file will be overwritten.

save stores data to a desired filepath and filename.

If option replace is specified, a former saved file will be overwritten.

Remarks

This command from the opendf package is part of the Open Data Format Project bundle, written to assist with survey data files in the open data format(.zip).

Due to cross-plattform compability of the Open Data Format some Stata-specific features are not supported by the ODF.

There are no value label names in the ODF. Therefore, value label names are lost when a datset is written to ODF. Value labels reveice generic names when an ODF file is read in Stata.

Extended missings for numeric variables (.a, .b, ..., .z) are not available in ODF specification. Therefore, extended missings are converted to ordinary missings (.)

Value Labels of extended missings er not written to ODF file.

Examples

Read the opendf-file testdata.zip from "https://opendataformat.github.io/stata-package-opendf/example_data/soep_data.zip" into Stata. The clear ensures, that the old dataset is removed from Stata cache.

With the save()-option the dataset is saved as testdata.dta in the working directory. If it already exists, it testdata.dta is replaced, verbose option is set on.

. opendf read "https://opendataformat.github.io/stata-package-opendf/example_data/soep_data.zip", clear save("testdata") replace verbose

Read the opendf-file testdata.zip from "https://opendataformat.github.io/stata-package-opendf/example_data/soep_data.zip" into Stata. clear ensures, that the old dataset is removed from Stata cache.

. opendf read "https://opendataformat.github.io/stata-package-opendf/example_data/soep_data.zip", clear

Read the first 10 lines of the opendf-file testdata.zip from "https://opendataformat.github.io/stata-package-opendf/example_data/soep_data.zip" into Stata. Since the first line is also the header, the range has to be set to 11.

. opendf read "https://opendataformat.github.io/stata-package-opendf/example_data/soep_data.zip", rowrange(:11)

Author

Tom Hartl (thartl@diw.de), Deutsches Institut für Wirtschaftsforschung Berlin.

Also see

Help: opendf write, opendf docu