lagdata:
Creating single lagged and moving average variables
Description
Function lagdata creates single lagged and moving average variables of the lag number that the user designate.
Usage
lagdata(data, varlist, laglength)
Arguments
data
Data includes lagged variables.
varlist
List of variables to be lagged.
laglength
Number of lag days.
Value
lagdata gives single lagged variables (varname_sxx, xx indicates lag length) and moving average variables (varname_mxx).
Details
Certain exposure on the previous days has an effect on the event on now day. This effect is referred to as the lagged effects. Studies wanting to estimate lagged effects would include the exposure value for previous days in the time series model, and those wanting to estimate cumulative effect of the same day and the previous days would include the moving average value of the exposure.
References
Dominici F. Time-series analysis of air pollution and mortality: a statistical review. Research report
(Health Effects Institute), (123):3, 2004.
Gasparrini A and Armstrong B. Time series analysis on the health effects of temperature: advancements
and limitations. Environmental research, 110(6):633-638, 2010.