Hi folks!

 

How do I extract lags from a formula?  An example:

 

mod.eq<-formula(x~lag(x,-1)+lag(x,-2))

> mod.eq

x ~ lag(x, -1) + lag(x, -2)

> mod.eq[1]

"~"()

> mod.eq[2]

x()

> mod.eq[3]

lag(x, -1) + lag(x, -2)()

 

I'm trying to extract the lags into a vector that would be simply [1,2].
How do I do this?  I'm using the dyn package to do dynamic regression.

 

John


	[[alternative HTML version deleted]]

