getShiftValues: Function for creating lagged/leading value variables from...

getShiftedValuesR Documentation

Function for creating lagged/leading value variables from LONG data

Description

Function for creating lagged/leading value variables from LONG data.

Usage

getShiftedValues(
	data_table,
	shift_group=c("ID", "CONTENT_AREA"),
	shift_period="YEAR",
	shift_variable="SCALE_SCORE",
	shift_amount=1L,
	shift_type="lag")

Arguments

data_table

Data table to add lagged/leading variable(s) to.

shift_group

Variable(s) indicating groups for which to create lagged/leading variables for.

shift_period

Variable indicating what period the lagged/leading shift occurs relative to.

shift_variable

Variable that lagged/leading values are derived from.

shift_amount

Number of period(s) that the shift_variable is shifted relative to the shift_period.

shift_type

Either "lag" or "lead".

Details

Typical use of the function is to create prior scale score for students from a LONG formatted longitudinal file.

Value

Function returns the submitted data_table and appends additional variables with suffixes added to the shift_variable name. For example SCALE_SCORE_LAG_1.

Author(s)

Damian W. Betebenner dbetebenner@nciea.org

Examples

	## Not run: 
		getShiftedValues(SGPdata::sgpData_LONG)
	
## End(Not run)

CenterForAssessment/cfaTools documentation built on June 2, 2022, 9:23 a.m.