diff.pserie {plm} | R Documentation |
Computes the first difference of variables that have a time and an individual dimension.
diff.pserie(x,lag=0, ...)
x |
a numeric vector for which the difference should be computed, |
lag |
the lag for the first difference, |
... |
further arguments. |
a vector of the same dimension as x
containing the
lag values. NA
values are inserted at the correct positions.
Yves Croissant
# 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")