Skip to content
Prev 27475 / 63421 Next

Feature request: about lag(), which.min() and cat().

On Jan 31, 2008 8:24 AM, Matthieu Stigler <stigler3 at etu.unige.ch> wrote:
It would be nice.  Note that lag.zoo in the zoo package does supports this
for zoo objects.
lag1 lag2
1  144  169
2  169  196
3  196  225
4  225  256
5  256  289
6  289  324
7  324  361
8  361  400
9  400   NA
Call:
lm(formula = dyn(z ~ lag(z, 1:2)))

Coefficients:
 (Intercept)  lag(z, 1:2)1  lag(z, 1:2)2
           2             2            -1

# as a workaround one could convert to zoo and back
Time Series:
Start = 1
End = 9
Frequency = 1
  lag1 lag2
1  144  169
2  169  196
3  196  225
4  225  256
5  256  289
6  289  324
7  324  361
8  361  400
9  400   NA