I didn't see you got an answer posted to this question:
You can't modify a pdata.frame object. Your transforms turn it back to a
normal data frame and diff and lag won't work as expected.
Try:
Grunfeld.p - pdata.frame(Grunfeld,c(firm,year))
tmp - transform(Grunfeld.p, d.value =
I have an unexpected result with the functions lag() and diff() in the plm
(panel data) package when used with transform(). These plm-specific
functions are supposed to generate lags and first differences within each
panel.
lag() does not work properly the first time (it reproduces the same
2 matches
Mail list logo