Learn R Programming

plm (version 0.1-2)

diff.pserie: Difference operator for panel data

Description

Computes the first difference of variables that have a temporal 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.

See Also

lag.pserie

Examples

Run this code
# 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")

Run the code above in your browser using DataLab