pdiff {plm} | R Documentation |
Computes the first difference of variables that have a temporal and an individual dimension.
pdiff(x,lag=0)
x |
a numeric vector or a numeric matrix for which the difference should be computed, |
lag |
the lag for the first difference. |
a vector (or matrix) of the same dimensions as x
containing the
lag values. NA
values are inserted at the correct positions
library(Ecdat) data(Produc) Produc=pdata.frame(Produc,state,year) pmean(Produc$pc) form <- pmean(log(gsp))~pmean(log(pc)) lm(form,data=Produc)