.org [mailto:r-help-boun...@r-project.org]
On Behalf Of saraberta
Sent: Wednesday, July 25, 2012 4:10 AM
To: r-help@r-project.org
Subject: [R] lagged variables
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 r
On Wed, Jul 25, 2012 at 4:10 AM, saraberta 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 23231
>
> w
Hello,
You are doing nothing wrong. Follow this example.
x <- ts(1:5)
# Seems the same with different start and end
lag(x)
# But it's not
cbind(x, lag(x))
Are there other functions? I know of at least one. (In the end.)
These two, though not lags, might also be of interess to you.
?window
y <-
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 23231
where do i wrong?are there other functions to be used?
thanks
sara
4 matches
Mail list logo