createlagvars: createlagvars

Description Usage Arguments Details

View source: R/createlagvars.R

Description

Creates lagged explanatory and response variables for data in long format.

Usage

1
createlagvars(data, vars, id, time = time, wide, filter_options)

Arguments

data

Name of dataframe that has been transformed in strm (object modframe0).

vars

Response and explanatory variables to be lagged.

id

Group identifier (example: state).

time

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.

wide

Boolean indicator. Takes TRUE if data is in wide format and FALSE if data is in long format. Default is FALSE.

filter_options

Additional arguments to be passed to dplyr::filter().

Details

Create lagged and transformed variables


strm documentation built on Jan. 19, 2022, 9:06 a.m.