dlm: Distributed lag model

View source: R/dlm.R

dlmR Documentation

Distributed lag model

Description

This estimates a distributed lag model (DLM) with a natrual spline basis. The model is estimated with the glm function form the stats package.

Usage

dlm(Y, X, Z, df, family = gaussian)

Arguments

Y

Vector of outcomes.

X

Matrix of exposures over an evenly spaced grid. There should be no missing exposures.

Z

Optional design matrix or data.frame of covariates. An intercept will be added

df

Degrees of freedom for the natrual spline basis

family

A description of the error distribution and link function to be used in the model.

Value

An object of class dlm. This is a list containing: “dlm“ the fitted distribued lag function; “cumulative“ estimates of the cumulative effect; and “modelfit“ which contains AIC and BIC for the fitted model; “basis“ is the natrual spline basis for the dlm; and “fit“ the fitted object returned from glm.


AnderWilson/regimes documentation built on Aug. 5, 2023, 8:30 a.m.