help for makeddi-

Syntax

makeddi using filename , [ Options ]

where filename refers to a do-file where variable derivation script is written

Sections

Sections are presented under the following headings:

Command description
Options description
Examples

options

Basics
variables(string) List variables to be documented. May not be combined with data option.

Advanced
data(string) Name of the data where variables names will be taken.

sort Document variables in alphabetical order. May be combined only with data option

exclude(string) Exclude variables from data.

Export
name(string) Name of the DDI that will be generated.

rootddi(string) Folder where DDI will be saved.

add(string) Add variables to existing DDI.

replace Replace existing DDI.

Description

makeddi aims to improve the quality and efficiency of the meta-data documentation production.
The idea behind this tool is to extract from the do-file and locate into the DDI file the code
lines that derivate the variables of the micro data that is intended to be documented. makeddi
identifies specific lines of code that create and modify each variable of the data. These
lines of code are stored and located in the particular fields of the "variable derivation"
section of the
Data Documentation Initiative (DDI) XML file.
makeddi generates a XML file that will be ready to be loaded by the Metadata Editor
(IHSN). Whenever you generate a DDI,
makeddi will allow you open the file .xml just clicking the 'Open' link.

Options description

Basics

variables(string) Specify variables to be documented in the DDI. Undoubtedly more than one variable is allowed.

Advanced

data(string) Search in data the variable names to be documented. Option data and variables are mutually exclusive. Either you specify the variables in variables or ask the command to look for the variables in data.

sort Document variables in alphabetical order i.e. first docucment variable "make", then "mpg", "price" and so on.

exclude(string) This option is useful when you do not want to document some variables. For instance those that may alter confidentialy or privacy like for example household id. Variables in exclude option are not documented.

Export

name(string) Set name of the DDI.

rootddi(string) Set path where the DDI will be stored. Default is current directory.

add(string) It may be the case that the user may want to add a variable (or more than one) to an existing DDI. If so, this is the option
that should be used. The default option uses a template xml to document the variable creation, but if this option is activated instead of starting from the template makeddi uses an existing DDI.

replace Replace existing DDI (.xml file).

Examples

Variables

makeddi using "test.do", variables(weight income consumption id) name(DDI-Auto)

Make DDI for variables weight, income, consumption and id; DDI is saved in current directory.

makeddi using "test.do", variables(weight income consumption id) name(DDI-Auto) rootddi(C:\mydata\)

Make DDI for variables weight, income, consumption and id; DDI is save in C:\mydata.

makeddi using "test.do", variables(weight income consumption id) name(DDI-Auto) rootddi(C:\mydata\) replace

Replace existing DDI.

Data

makeddi using "test.do", data(auto) replace name(DDI-Auto)

Generate DDI for variables present in data.

makeddi using "test.do", data(auto) replace sort name(DDI-Auto)

Generate DDI for variables the present in data and sort them in alphabetical order.

makeddi using "test.do", data(auto) replace exclude( mpg rep78 headroom ) name(DDI-Auto)

Generate DDI for the variables present in data excluding mpg rep78 and headroom.

Add information on existing DDI

makeddi using "test.do", add(C:\mydata\DDI-Auto.xml) var(tempvar) name(DDI-Auto2)

Add variable tempvar to existing DDI-Auto.xml and named the new DDI as DDI-Auto2.xml

Authors

Santiago Garriga, The World Bank

Email sgarriga@worldbank.org

Email garrigasantiago@gmail.com

R.Andres Castaneda, The World Bank

Email acastanedaa@worldbank.org

Email r.andres.castaneda@gmail.com

Also see other Stata program by the same authors

do2screen (if installed)