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:

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:

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 example in the package do not use parallel implementation. If you have 4 cores available, try using the parallel=TRUE option.