[R] lagged variables

Gabor Grothendieck ggrothendieck at gmail.com
Wed Jul 25 13:30:55 CEST 2012


On Wed, Jul 25, 2012 at 4:10 AM, saraberta <sara.bertapelle at hotmail.it> wrote:
> hi guys,
> i have some trouble in creating lagged variables to use as external
> regressors.
> i'm trying to use lag(x) but it gives me as result the same time series (x),
> adding this part at the end:
>
> attr(,"tsp")
> [1]    0 2323    1
>
> where do i wrong?are there other functions to be used?
> thanks
> sara
>

The dyn and dynlm packages address this problem.

-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list