[R] lag() and lm()

About this list Date view Thread view Subject view Author view Other groups

Subject: [R] lag() and lm()
From: Abu Hammour (hammour@msn.com)
Date: Thu 21 Sep 2000 - 03:00:52 EST


Message-ID: <000701c02324$586ff160$aa88173f@lawrence>

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@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._


About this list Date view Thread view Subject view Author view Other groups

This archive was generated by hypermail 2b25 : Thu 01 Feb 2001 - 16:14:24 EST