The R package dlnm
The package dlnm contains functions to specify and run distributed lag linear and non-linear models (DLMs and DLNMs) in R. This modelling framework is applied to describe simultaneously (potentially) non-linear and delayed dependencies, termed exposure-lag-response associations.
The package has been stored on the Comprehensive R Archive Network (CRAN) (see the related page) since July 2009, and it is downloadable directly through R. It contains a series of functions to specify the models, and then predict and plot the results, plus other auxiliary functions, and data used in examples. The documentation includes help pages for the package and each function, then a series of vignettes with more details and example. Specifically, the first vignette provides an overview of the package, a second vignette illustrates the use of DLMs/DLNMs in time series data, and third vignette describes the generalization to other study designs and the application of user-defined functions.
An article published in the Journal of Statistical Software originally introduced the package. Although the content and syntax have substantially changed since the publication, this should be considered the main reference for citation purposes.
The DLM/DLNM methodology for time series data is described in this article. Its definition of a general conceptual and statistical framework for modelling bi-dimensional exposure-lag-response associations, extended to other study designs and data structures, is illustrated in another article. The extension to penalized splines within generalized additive models is instead described in this other article. The package has been used in several applications (see some examples in the R code section).
The package has been stored on the Comprehensive R Archive Network (CRAN) (see the related page) since July 2009, and it is downloadable directly through R. It contains a series of functions to specify the models, and then predict and plot the results, plus other auxiliary functions, and data used in examples. The documentation includes help pages for the package and each function, then a series of vignettes with more details and example. Specifically, the first vignette provides an overview of the package, a second vignette illustrates the use of DLMs/DLNMs in time series data, and third vignette describes the generalization to other study designs and the application of user-defined functions.
An article published in the Journal of Statistical Software originally introduced the package. Although the content and syntax have substantially changed since the publication, this should be considered the main reference for citation purposes.
The DLM/DLNM methodology for time series data is described in this article. Its definition of a general conceptual and statistical framework for modelling bi-dimensional exposure-lag-response associations, extended to other study designs and data structures, is illustrated in another article. The extension to penalized splines within generalized additive models is instead described in this other article. The package has been used in several applications (see some examples in the R code section).