MyNixOS website logo
Description

Days Alive and Out of Hospital (DAOH) Calculation.

Calculates Days Alive and Out of Hospital (DAOH) from administrative admission/discharge/mortality data using three algorithms (nights, days, exact) and three death-handling approaches (midday, midnight, zero). Includes tools for comparing methods (Bland-Altman, ICC, reclassification), and plotting.

daoh

R package for calculating Days Alive and Out of Hospital (DAOH)

Supports all three hospital-time algorithms (nights, days, exact) and all three death-handling approaches (midday, midnight, zero), with tools for comparison, and visualisation.

Installation

# From source (once on CRAN or GitHub)
# install.packages("daoh")

# From local source
devtools::install("path/to/daoh_package/daoh")

Quick start

library(daoh)

# Load the built-in day-stay example
ex <- load_example("daystay")

# Nights algorithm: same-day admission = 0 nights → DAOH = 30
calc_daoh(ex$events, ex$index_dates, period = 30, method = "nights")

# Days algorithm: same-day admission = 1 day → DAOH = 29
calc_daoh(ex$events, ex$index_dates, period = 30, method = "days")

Key functions

FunctionPurpose
calc_daoh()Main DAOH calculation
load_example()Load synthetic example datasets
bland_altman_daoh()Bland–Altman agreement statistics
daoh_icc()Intraclass correlation across methods
daoh_reclassify()Quartile reclassification analysis
plot_daoh_dist()Distribution plot (Figure 2 style)
plot_daoh_ba()Bland–Altman plot
plot_daoh_reclassify()Reclassification heatmap

Examples

Three synthetic datasets are included:

  • "daystay" — single day-stay illustrating the nights vs days difference
  • "death" — four admissions + in-period death (Figure 1 worked example)
  • "population" — 500-patient cohort for method comparison

See vignette("getting_started", package = "daoh") for a full walkthrough.

Citation

DOI: 10.5281/zenodo.20671491

Metadata

Version

0.1.0

License

Unknown

Platforms (79)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    wasip1
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasip1
  • wasm64-wasip1
  • x86_64-cygwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows