This package fits the distributed lag models (DLMs) described by Baek et
al (2016) and Baek et al (2017), which estimate the association between
the presence of built environment features and an outcome as a function
of distance between the locations for study participants and locations for
environment features or community resources. These models circumvent the
need to pre-specify a radius within which to measure the availability of
community resources. Distributed lag models have a long history in a
variety of fields. For built environment research, we define the lagged
exposure as the value of an environment feature between two radii,
*r_{l-1}* and *r_l*
from study locations, *l = 1, 2, ..., L*,
where *r_0 = 0*; e.g., the lagged exposure is the number
of convenience stores within “ring”-shaped areas around study participants
residential address. The package supports generalized linear regression
models, as well as generalized linear mixed models. In both instances,
multiple lagged exposure covariates maybe included, as well as
interactions between the lagged covariates and other categorical
covariates (e.g., quartiles of age).

Let *Y_{ij}* be an outcome measured at location *i* at visit
*j*, and *X_{ij}(r_{l-1}; r_l)*
be an environment feature measured during visit *j* within a
ring-shaped area around location *i* between radii *r_{l-1}*
and *r_l*; and *r_L* be the maximum distance
around locations beyond which there is no association between the
environment feature and the outcome. A typical unadjusted generalized
linear mixed model that can be fitted in this version of the package is,

*g(E(Y_{ij} | b_i)) = β_0 + ∑_{l=1}^L β(r_{l-1}; r_l) * X(r_{l-1}; r_l) + W_{ij} * b_i*

where *g()* is a link function appropriate for the
distribution of the outcome; *β_0*
represents an intercept; the association of the environment feature
measured between radii *r_{l-1}* and *r_l* and the outcome is
*β(r_{l-1}; r_l)*; and *W_{ij}* are covariates related
to random effects, *b_i* (e.g., random intercepts and slopes).
The coefficients *β(r_{l-1}; r_l)* are constrained to follow a
smooth function of distance
from the locations of interest; the constraint is imposed by modeling the
coefficients using smoothing splines. Other models could be used, although
smoothing splines are the only supported option at this time.

The model easily simplifies to generalized linear regression modes
(e.g., when there is only one visit), and can be extended in the following
directions. Adjustment covariates can be easily included. In addition,
interaction terms between covariates and the DL covariates are
also supported. For example, terms such as:
*∑_{l=1}^L θ(r_{l-1}; r_l) * X(r_{l-1}; r_l) * Z_i*,
where *Z_i* is another covariate, can be included. The interaction
coefficients *θ(r_{l-1}; r_l)* have the
usual interpretation, but the magnitude of the interaction can vary over
distance from locations of interest; *θ(r_{l-1}; r_l)* are also
constrained using smoothing splines. Finally, weighted regression models
are also supported.

We assume the user has calculated distances from every participant’s
location to every community resource/feature. The distances can be network
distances or Euclidian distances. Those distances are then used to calculate
the distributed lag covariates, *X(r_{l-1}; r_l)*, by specifying *L*
and the radii *r_l*, *l = 1, 2, ..., L*.
See Baek et al (2016) for guidance on choosing *L* and *r*.

The package includes a series of functions to pass formulas and data to lme4, which is used for estimation of the DLM. All those functions are documented in this manual, although a typical user will primarily interact with XXX, xxx, and xxx. For example:

Baek J, Sanchez BN, Berrocal VJ, & Sanchez-Vaznaugh EV (2016) Epidemiology 27(1):116-24. (PubMed)

Baek J, Hirsch JA, Moore K, Tabb LP, et al. (2017) Epidemiology 28(3):403-11. (PubMed)

Bates D, Maechler M, Bolker BM, & Walker SC (2015) Fitting linear mixed-effects models using lme4. J Stat Softw 67(1). (jstatsoft.org)

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.