Methods notes

Data Management

What a codebook is

The document that tells a later reader what each variable is, how it was measured, and how values should be read.

Tabulated papers and records. A codebook tells a later reader what each variable means.

A codebook is the document that tells a later reader what each variable is, how it was measured, and how values should be read. Without it, a dataset is a grid of numbers with fading memory attached.

What belongs in it

At minimum it lists the variable name, a plain language label, the type of measure, the allowed values, and the meaning of each code. For a survey it should also record the exact item wording, who was asked, skip logic, and the source if the item was taken from another instrument.

Codes for missing, refused, and not applicable belong in the codebook, not as blank cells that later get guessed. If 8 means refused and 9 means do not know, write that down. Future you will not remember.

Derived variables need a recipe

If wealth is a score built from assets, the codebook should say which items went in, how they were combined, and which file version the score was computed on. A colleague should be able to rebuild the variable from the original items.

A codebook is not a data dictionary generated and never read. Generate a draft from the instrument or the software, then edit it so a human can use it. Labels that say Q14 with no wording fail that test.

Keep the codebook with the dataset it describes, and version both. When a label changes, the codebook version changes. The original data file does not.

Another analyst should be able to apply the codes without a private conversation.

The qualitative analogue

For qualitative work the analogue is the coding frame: code name, definition, inclusion rules, exclusion rules, and an example. The purpose is the same.

If you receive a file with no codebook, the first task is to build one from the instrument, the field notes, and any surviving syntax. Analysis that starts before that work is analysis of an unknown object.

Need this method on a live study?

Request a quote. After you agree scope and fee, create an account and start the project from your dashboard.