Skip to content
Prev 11066 / 398502 Next

writing equations

On Friday 04 May 2001 22:17, Antonio Olinto wrote:
What I do is build a lagged version of the data frame.  Since I tend to
use lagged data with different lags a lot, I'll generally predefine a lag
called tau (in your example tau=1) and then use it like so:

tau <- 1
theFrame <- data.frame(x1=X[1:(length(X)-tau)],
                       x2=X[(1+tau):length(X)],
                       y1=Y[1:(length(X)-tau)],
                       y2=Y[(1+tau):length(X)])

Now you can use these new lagged variables however you want in your formula.

Cheers,
Steve Boker
sboker at nd.edu
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._