diff.pserie {plm}R Documentation

Difference operator for panel data

Description

Computes the first difference of variables that have a time and an individual dimension.

Usage

diff.pserie(x,lag=0, ...)

Arguments

x a numeric vector for which the difference should be computed,
lag the lag for the first difference,
... further arguments.

Value

a vector of the same dimension as x containing the lag values. NA values are inserted at the correct positions.

Author(s)

Yves Croissant

See Also

lag.pserie

Examples

# Anderson and Hsiao estimator
library(Ecdat)
data(Grunfeld)
pdata.frame(Grunfeld,"firm","year")
form <- diff(inv)~diff(inv,1)+diff(value)+diff(capital)
hs <- plm(form,data=Grunfeld,instruments=~lag(inv,2),endog=~diff(inv,1),model="pooling")

[Package plm version 0.2-2 Index]