Skip to main content

dansk-register

A platform for epidemiological studies on the Danish national registers, and the study pipelines built on it.

The package contains no data. It is the code that reads a register delivery inside a secure research environment, builds cohorts and outcomes from it, and estimates and reports the results.

What is in it

Package Role
dansk_register The reusable platform: register catalog and I/O, the staged-pipeline runner, matching, estimation, disclosure control, figure styling
societal_costs Study II: societal costs of severe chronic disease in childhood
edu_labour_trajectories Study III: educational and labour-market trajectories from age 18

The dependency direction is one way and enforced by a test: the platform never imports a study, and studies never import each other. Code that turns out to be general is lifted into dansk_register rather than shared sideways.

Install

pip install dansk-register-platform
pip install "dansk-register-platform[figures]"   # adds matplotlib to render figures

The distribution was renamed from dansk-register at 0.7.0, to get past the analysis server mirror's 24-hour cache. The import packages are deliberately unchanged, so nothing in this codebase or on the server imports anything different; only pip install names the new one. The old name still resolves, to a distribution that stopped being updated before the rename.

The figures extra is optional on purpose. The estimators are written in polars and validated against R, so the pipeline itself carries no numeric stack; matplotlib brings numpy and is needed only to draw. Without it every result is still produced and the figure stage records that it could not render.

Commands

edu-labour --list-profiles                          # what each profile runs
edu-labour-preflight --raw-root PATH                # what a delivery contains
edu-labour --output-dir RUN --profile production \
    --raw-root PATH --allow-expensive-stages --resume
edu-labour-figures --bundle RUN/outputs/export --out figures

societal-costs --output-dir RUN --profile production

Add --dry-run to any edu-labour invocation to resolve the plan and settings without touching data.

Design notes

Stages talk through files. Every stage writes named artifacts into a run directory and reads its inputs from there, so any stage can be re-run alone against a previous run's outputs, and --resume can skip what is already done.

Estimators are written against polars. Aalen-Johansen, Fine-Gray, Cox and the multi-state occupancy are implemented directly rather than taken from a modelling library, and each is validated against reference values from R with those values checked into the tests. That keeps the numbers checkable line by line and avoids a dependency that may not install in an offline environment.

Disclosure control is part of the pipeline. Results leave the secure environment as a bundle of CSV tables with small cells suppressed and the estimates resting on them blanked. Figures are rendered from that bundle rather than from the raw artifacts, so a figure cannot show what the table beside it was not cleared to show.

Status

Research code, developed alongside the studies it implements. The public API is not stable.

Licence

MIT. See LICENSE.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dansk_register_platform-0.9.0-cp312-cp312-win_amd64.whl (7.6 MB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file dansk_register_platform-0.9.0-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for dansk_register_platform-0.9.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9498bd1a7b5b76f91111961628754ccb08111b9f5abeb40eb6ac67defca5bb82
MD5 432e8ceb2f1968a6b15bae1ddedc32b0
BLAKE2b-256 de5f0e874270b52af03bded63e5ccf345ed30aebf344cc50db6432dcbb9af31b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.18.2

1 file

0.18.1

1 file

0.17.0

1 file

0.16.0

1 file

0.15.0

1 file

0.14.0

1 file

0.13.0

1 file

0.11.0

1 file

0.10.0

1 file

This release

0.9.0 This release

1 file

0.8.0

1 file

0.7.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page