*! version 1.0.0 26Sept2018

Title

htmlcb -- Write a codebook as an HTML file

Syntax

htmlcb
, saving(filename) [options]

Main
saving(filename) filename for the codebook

replace overwrite file specified in saving() if it already
exists

files(["]filename["] [["]filename["]] [...])
Stata data files for which the codebook is to be created

dir(["]directory_name["]) the codebook is made for all Stata data files in directory_name

title(string) title for the codebook; default is Codebook

selfcontained codebook is viewable on device without internet access

fast creating the codebook is faster, but the codebook will contain less information

Description

htmlcb creates an codebook in an HTML file from one or more Stata datasets.
By default it will make a codebook for the dataset that is currently in memory,
unless either the files() or the dir() option is specified.

htmlcb displays for each dataset the data label, notes, number of variables,
number of observations, when it was last saved, and the datasignature. For
each variable it always displays the variable label, notes, and the numbers of missing
and non-missing values.

If the fast option is not specified it will also display the number of
distinct non-missing values. In that case htmlcb will also show for each
variable a frequency table if that variable has value labels or the number of
distinct values is less than or equal to 10. If the number of distinct values is
larger than 10 and it has no value labels, then it will show the minimum, the
three quartiles, and the maximum.

If the fast option is specified htmlcb will show the minimum, mean,
and maximum for all variables.

Options

Main

saving(filename) the filename under which the codebook is to be stored.

replace overwrite file specified in saving() if it already exists.

files(["]filename["] [["]filename["]] [...])
specifies the Stata data files that the codebook will describe. Specifying
multiple files is particularly useful for a dataset that is stored in multiple
files, so that you want to describe all files in one codebook.

dir(["]directory_name["]) the codebook will
describe all Stata datasets in the directory directory_name. If you want
to specify the current working directory you can use dir(.).

title(string) title for the codebook; default is Codebook

selfcontained codebook is viewable on a device without internet
access. The codebook uses the W3.CSS framework, and by default a link to the
w3.css file. If one intends to use the codebook on a device without internet
access, then the codebook will not look as intended. For those instances one
can specify the selfcontained option which will copy the entire w3.css
file in the <style> block.

fast creating the codebook is faster, but the codebook will contain less
information. Especially in a large dataset, htmlcb can take a while. The
fast option can speed that up, but at the cost of a less informative
codebook. The differences are discussed in the Description.

Examples

Use the data file currently in memory

. sysuse auto

. htmlcb, saving(autocb.html)

Copy some datasets in the current working directory

. sysuse auto

. save auto_copy

. sysuse nlsw88

. save nlsw88_copy

Use the files() option to indicate which datasets will be described.

. htmlcb , files(auto_copy nlsw88_copy) saving(files.html)

Use the dir() option to describe all Stata datasets in the current working
directory.

. htmlcb , dir(.) saving(dir.html)

Author

Maarten Buis, University of Konstanz

maarten.buis@uni.kn