Creates lagged explanatory and response variables for data in long format.
createlagvars(data, vars, id, time = time, wide, filter_options)Name of dataframe that has been transformed in strm (object modframe0).
Response and explanatory variables to be lagged.
Group identifier (example: state).
Number of time periods in the dataset. Lags will be taken for each time period. Default is 2 time periods. For a spatial-only regression model, set time=1.
Boolean indicator. Takes TRUE if data is in wide format and FALSE if data is in long format. Default is FALSE.
Additional arguments to be passed to dplyr::filter().
Create lagged and transformed variables