help for dta2ddi
Minh Cong Nguyen

dta2ddi - DDI maker from Stata

dta2ddi,
[using(string)
save(string)
append(string)
id(string)
stats(string)
replace
xxx(string)
yyy(string)
zzz(string)
aaa(string)
bbb(string)
ccc(string)
ddd(string)
eee(string)
fff(string)
ggg(string)
hhh(string)
iii(string)
jjj(string)
kkk(string)
lll(string)
mmm(string)
nnn(string)
ooo(string)
ppp(string)
qqq(string)
rrr(string)
sss(string)
ttt(string)
uuu(string)
vvv(string)]

Description

dta2ddi is a tool to convert Stata data into DDI standards. The current DDI standard is 1.12
and it will also incorporate the other standards (2.5 and 3.x) when they are used widely in practice.

The tool will create an XML-based file, which is compatiable with any DDI software such as Nesstar Publisher. The main purpose of the tool is to
create a large number of DDI files in a semi-automatic manner for the new or revised database. The parts from the database are
file descriptions, variable descriptions. Document and study descriptions are entered externally, either from an existing DDI file or other sources.

Thanks for citing dta2ddi as follows

Minh Cong Nguyen (2014) DDI maker from Stata. World Bank. (mimeo)

Where

using is the files or the folder name which contains several data files.

save is the link for saving the DDI file.

append is the link to the file where it will append the information with the new DDI file.

id is the name of the DDI (optional).

stats is the statistics you can add to the DDI (min, max, mean, stdev).

Options

xxx is the information you can modify in the appended file (append option). In the append file, you can refer it to ;XXX; in the template/appened DDI.

...

vvv is the information you can modify in the appended file (append option). In the append file, you can refer it to ;VVV; in the template/appened DDI.

Saved Results

dta2ddi returns results in r() format.
By typing return list, the following results are reported:

Scalars

r(cmdline) the code line used in the session

Examples

tempfile filename
import excel using "DDI_folders.xlsx", clear firstrow
save "$ddiout/`filename'", replace
local N = _N
forv i = 1(1)`N'{
use "$ddiout/`filename'", clear}

. dta2ddi, using(`=path[`i']') save($ddiout\\`=folder[`i']'.xml) append($append) id(`=folder[`i']') xxx(`=ctry[`i']') yyy(`=year[`i']') zzz(`=folder[`i']') aaa(`=code[`i']') bbb(`=datadate[`i']') ccc(`=veralt[`i']') ddd(July 2014)

}

.dta2ddi, using("c:\DDI\UKR_2012_HLCS_v01_M_v01_A_ECAPOV") save("c:\DDI\UKR_2012_HLCS_v01_M_v01_A_ECAPOV.xml") replace append("c:\DDI\ALB_2012_LSMS_v01_M_v01_A_ECAPOV.xml")

References

Data Documentation Initiative (website)
(link to publication)

Micro Data Library (website)
(link to publication)

Authors

Minh Cong Nguyen, congminh6@gmail.com or mnguyen3@worldbank.org

Acknowledgements

The author would like to thank Joao Pedro Azevedo, Matthew John Welch, Mehmood Asghar, Julia Dukhno for their valuable suggestions.

All errors and ommissions are of exclusive responsability of the author.

Also see

Online: help for apoverty; ainequal; wbopendata; frcount; xtsur; adecomp (if installed)