UKB_database

DuckDB Database system for storing and extracting UKB data

Jennifer Collister, Xiaonan Liu

Translational Epidemiology Unit, NDPH

Pre-requisites

Set-up

You will need R installed.

I recommend cloning this repository onto your computer and using renv to install the required packages as specified in the project lock file.

Alternatively, you can install the necessary packages manually.

If you want to extract data into Stata, you will also need to install Python and Stata version 17.

Creating the database

See Creating the database.

Extracting data in R

See Extracting data in R.

Extracting data in Stata

See Extracting Data in Stata.

Cautionary Note

The database system duckdb is still under development, which means that unfortunately new versions are often not backwards compatible. This means a database written under one version of duckdb cannot be read by a later version.

Please consider using some form of package management, for example renv to facilitate control over package versions.