MyNixOS website logo
Description

Bayesian Distributed Lag Interaction Models.

Estimation and interpretation of Bayesian distributed lag interaction models (BDLIMs). A BDLIM regresses a scalar outcome on repeated measures of exposure and allows for modification by a categorical variable under four specific patterns of modification. The main function is bdlim(). There are also summary and plotting files. Details on methodology are described in Wilson et al. (2017) <doi:10.1093/biostatistics/kxx002>.

bdlim

R-CMD-check CRAN status Downloads

Overview

bdlim is an R package that implements Bayesian distributed lag interaction models (BDLIMs). This is a developmental package to replace code in regimes. I am currently testing the package and building additional functionality. Background on the model can be found in:

  • Wilson A, Chiu YM, Hsu HL, Wright RO, Wright RJ, Coull BA (2017). “Bayesian distributed lag interaction models to identify perinatal windows of vulnerability in children's health.” Biostatistics, 18(3), 537–552. (DOI: 10.1093/biostatistics/kxx002, arXiv preprint)

In short, BDLIM estimated a distributed lag model (DLM) with modification by a single categorical variable. The categorical variable can be binary or more than two levels, but BDLIM is not advised when there are a large number of categories. If you are instead interested in a DLM with modification by a single continuous variable see the dlim package (see website here). If you are interested in distributed lag models with heterogeneity by with multiple modifiers see the heterogeneous distributed lag model in the dlmtree package.

This package includes several improvements over the previous software. Many of these improvements come from user feedback and more experiance applying the BDLIM to multiple datasets. These include:

  • Simpler syntax
  • Updated options with some no longer recommended hyperparameter settings no longer available
  • Faster with options for parallel implementation
  • Summary and plot functions that provide more intuitive results.

Installation

The package can be installed from CRAN with the following code.

install.packages("bdlim")

Alternatively, it can be installed from GitHub using the code below.

remotes::install_github("anderwilson/bdlim")

Use

A vignette can be accessed at anderwilson.github.io/bdlim/articles/bdlim.html.

The main function is bdlim4. See the help file for that function for a simple example. The summary and plot functions can be used to make inference on the results. Specifically:

  • The model probabilities from the summary or indicate which pattern of heterogeneity is best supported by the data.
  • Cumulative effect estimates are provided in the summary function output.
  • The plot function show estimated distributed lag functions for each group. This returns a ggplot object that can be modified. See the help file example for plot.summary.bdlim4 for an example that modifies the plot.
  • Estimates of the distributed lag functions are available in the summary object but are not printed in the console. See the help file for summary.bdlim4 for an example.

The example in the package do not use parallel implementation. If you have 4 cores available, try using the parallel=TRUE option.

Metadata

Version

0.4.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • 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-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
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • 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-windows