Learn R Programming


dlnm: Distributed Lag Non-Linear Models

The package dlnm contains functions to specify and interpret distributed lag linear (DLMs) and non-linear (DLNMs) models. The DLM/DLNM methodology is illustrated in detail in a series of articles referenced at the end of this document.

Info on the dlnm package

The package dlnm is available on the Comprehensive R Archive Network (CRAN), with info at the related web page (https://cran.r-project.org/package=dlnm). A development website is available on GitHub (https://github.com/gasparrini/dlnm).

For a short summary of the functionalities of this package, refer to the main help page by typing:

help(dlnm)

in R after installation (see below). For a more comprehensive overview, refer to the main vignette of the package that can be opened with:

vignette("dlnmOverview")

Installation

The last version officially released on CRAN can be installed directly within R by typing:

install.packages("dlnm")

R code in published articles

Several peer-reviewed articles and documents provide R code illustrating methodological developments of dlnm or replicating substantive results using this package. An updated version of the code can be found at the GitHub (httpsgithub.com/gasparrini) or personal web page (http://www.ag-myresearch.com) of the package maintainer.

References:

Gasparrini A. Distributed lag linear and non-linear models in R: the package dlnm. Journal of Statistical Software. 2011; 43(8):1-20. [freely available here]

Gasparrini A, Scheipl F, Armstrong B, Kenward MG. A penalized framework for distributed lag non-linear models. Biometrics. 2017;73(3):938-948. [freely available here]://

Gasparrini A. Modelling lagged associations in environmental time series data: a simulation study. Epidemiology. 2016; 27(6):835-842. [freely available here]

Gasparrini A. Modeling exposure-lag-response associations with distributed lag non-linear models. Statistics in Medicine. 2014; 33(5):881-899. [freely available here].

Gasparrini A., Armstrong, B.,Kenward M. G. Distributed lag non-linear models. Statistics in Medicine. 2010; 29(21):2224-2234. [freely available here].

Gasparrini A., Armstrong, B., Kenward M. G. Reducing and meta-analyzing estimates from distributed lag non-linear models. BMC Medical Research Methodology. 2013; 13(1):1. [freely available here].

Armstrong, B. Models for the relationship between ambient temperature and daily mortality. Epidemiology. 2006, 17(6):624-31. [available here].

Copy Link

Version

Install

install.packages('dlnm')

Monthly Downloads

2,043

Version

2.4.7

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Last Published

October 7th, 2021

Functions in dlnm (2.4.7)

cr

Generate a Basis Matrix for Penalized Cubic Regression Splines
cbPen

Generate Penalty Matrices for a DLNM
chicagoNMMAPS

Daily Mortality Weather and Pollution Data for Chicago
dlnm-internal

Internal Functions for Package dlnm
crossbasis

Generate a Cross-Basis Matrix for a DLNM
dlnm-package

Distributed Lag Non-linear Models (DLNM)
crossreduce

Reduce the Fit of a DLNM to One-Dimensional Summaries
crosspred

Generate Predictions for a DLNM
coef.crosspred

Model Coefficients and their (Co)Variance Matrix of a DLNM
drug

A Trial on the Effect of Time-Varying Doses of a Drug
equalknots

Define Knots at Equally-Spaced Values
exphist

Define Exposure Histories from an Exposure Profile
poly

Generate a Basis Matrix of Polynomials
plot.crossreduce

Plot Predictions for a Reduced DLNM
ps

Generate a Basis Matrix for P-Splines
integer

Generate a Basis Matrix of Indicator Variables for Integer Values
lin

Generate a Basis Matrix with a Variable as Linear
smooth.construct.cb.smooth.spec

Cross-Basis Spline Smooths for a DLNM
onebasis

Generate a Basis Matrix for Different Functions
plot.crosspred

Plot Predictions for a DLNM
strata

Generate a Basis Matrix of Indicator Variables
thr

Generate a Basis Matrix of Linear Threshold Transformations
nested

Nested Case-Control Study with a Time-Varying Exposure and a Cancer Outcome
logknots

Define Knots for Lag Space at Equally-Spaced Log-Values