[R] lag() and lm()

Abu Hammour hammour at msn.com
Wed Sep 20 19:00:52 CEST 2000


Hi,
I am using R interactively for estimation and even data manipulation. I want
to use lag() function within lm() function in a way looks like:

mymodel<- lm(y~x+I(lag(y,-1)-1, data=anydata)

What I get is always perfect fit; (that is, coefficient=1) which is not
true.

If the model looks like
mymodel<- lm(y~z+x+I(lag(x,-1)-1, data=anydata)

summary returns only one coefficient for x and I(lag(x,-1))

Is there any way to do both of these models without going through long
process of transforming of x and y and making ts.intersect before running
lm() function.

Thank you,
Ahmad Abu Hammour



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list