Learn R Programming

estprod (version 1.2)

panel_lag: Panel data lag function

Description

This function aims create the lags of a specified variable from panel data.

Usage

panel_lag(x, id, time, lag = 1, verify = TRUE)

Arguments

x

A vector, data.frame, tibble or matrix.

id

A character with the name of the indicator variable.

time

A character with the name of the time variable.

lag

Number of lags.

verify

Check if panel is sorted by id and time variables.