How to Codebook

Felix Schönbrodt

Ludwig-Maximilians-Universität München

David Rieger

Ludwig-Maximilians-Universität München

2026-04-17

How to create a codebook aka. data dictionary

How to Codebook

See the D-Psy-FAIR standard (developed by Blask et al from the Leibniz-Institute Psychology)

Save in a human-readable (e.g., .csv) and in a machine-readable (e.g., .json) format!

Codebook: Which file format?

Excel file:
Human-readable:
Machine-readabe: ~
Accessible: ~

(Note re: “Accessible”: Proprietary file format; but as it is a widely used format, there are multiple open source apps which can open it). A better alternative is the open .ods spreadsheet format (e.g. from LibreOffice)

Codebook: Which file format?

csv file:
Human-readable: ~ (raw) (after import)
Machine-readable:
Accessible:

Codebook: Which file format?

json file:
Human-readable: ~ (raw)
Machine-readable:
Accessible:

Excursus: json file format

Excursus: json file format

How to Codebook: Manual

  • Step 1: Create your codebook as an Excel or LibreOffice spreadsheet file
  • Step 2: Export it as a .csv file
  • Step 3: Import into R and convert it to a .json file
library(jsonlite)
df <- read.csv("codebook.csv")
json <- toJSON(df, pretty = TRUE)
write_json(json,"codebook.json")
  • Step 4: Save both codebook files in the /doc subfolder of your project
  • Step 5: Upload both the .csv and the .json-file to the repository

How to Codebook: DataWiz2

https://datawiz2.beta.zpid.org

How to Codebook

End

Contact

CC-BY-SA 4.0