Learn R Programming

⚠️There's a newer version (2.4.7) of this package.Take me there.


Distributed Lag Non-linear Models (DLNM)

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 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 or replicating substantive results. An updated version of the code can be found at the GitHub (https://github.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

1,953

Version

2.3.9

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Last Published

March 11th, 2019

Functions in dlnm (2.3.9)

nested

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

Generate Predictions for a DLNM
integer

Generate a Basis Matrix of Indicator Variables for Integer Values
drug

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

Distributed Lag Non-linear Models (DLNM)
logknots

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

Generate a Basis Matrix with a Variable as Linear
strata

Generate a Basis Matrix of Indicator Variables
exphist

Define Exposure Histories from an Exposure Profile
coef.crosspred

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

Generate a Basis Matrix for Different Functions
crossreduce

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

Generate Penalty Matrices for a DLNM
dlnm-internal

Internal Functions for Package dlnm
chicagoNMMAPS

Daily Mortality Weather and Pollution Data for Chicago
smooth.construct.cb.smooth.spec

Cross-Basis Spline Smooths for a DLNM
cr

Generate a Basis Matrix for Penalized Cubic Regression Splines
plot.crosspred

Plot Predictions for a DLNM
ps

Generate a Basis Matrix for P-Splines
thr

Generate a Basis Matrix of Linear Threshold Transformations
poly

Generate a Basis Matrix of Polynomials
plot.crossreduce

Plot Predictions for a Reduced DLNM
equalknots

Define Knots at Equally-Spaced Values
crossbasis

Generate a Cross-Basis Matrix for a DLNM