Skip to content
Prev 26995 / 63434 Next

creating lagged variables

The problem is the representation.

If we transform it into a zoo time series, z, with one
series per column and one time point per row then we
can just merge the series with its lag.
+ 3, 1, 2, 3), value = c(-0.56047565, -0.23017749, 1.55870831,
+ 0.07050839, 0.12928774, 1.71506499))
1.z        2.z 1.lag(z, -1) 2.lag(z, -1)
1 -0.5604756 0.07050839           NA           NA
2 -0.2301775 0.12928774   -0.5604756   0.07050839
3  1.5587083 1.71506499   -0.2301775   0.12928774


On Dec 13, 2007 1:21 PM, Antonio, Fabio Di Narzo
<antonio.fabio at gmail.com> wrote: