LagI: Contextual lag with intrapolation

View source: R/lag.R

LagIR Documentation

Contextual lag with intrapolation

Description

Lags within clusters based on a time vector with possibly unequal intervals

Usage

LagI(x, id, time, lag = 1, delta = 0.01, check = T)

Arguments

x

vector to be lagged

id

clustering variable

lag

(default 1)

delta

(default .01)

check

(default TRUE) check for unique values of idx within each cluster

idx

time variable

Value

return the value of 'x' in the position 'idx - lag' in the same cluster calculated by intrapolation.

See Also

LagI, DiffI, Diff,


gmonette/spida2 documentation built on Aug. 20, 2023, 7:21 p.m.