Skip to content

ivreg and structural change

2 messages · Claudio Shikida (敷田治誠 クラウジオ), Achim Zeileis

#
On Mon, 1 Aug 2011, Claudio Shikida (??????????) wrote:

            
In principle, most of tests used in the standard linear regression model 
can also be transferred to the IV case. However, many of the functions in 
"strucchange" do not do this. A notable exception is the function gefp(), 
see its manual page for references. This allows you to do something like

   gefp(y ~ x1 + x2 | z1 + z2, fit = ivreg, data = d)

etc.
I guess that this does not do what you want it to do. I would guess that 
this essentially yields a standard linear regression because the lag() is 
not correctly processed. If you want to use ivreg(), you need to set up 
the lagged variables by hand in advance. Alternatively, you can use 
dynlm() from the "dynlm" package which allows you to use lag() or the 
simpler L() function in the formula together with "zoo" data.

For an example, how to set up the lagged variables by hand, you can look 
at the manual page of breakpoints(), especially the seatbelt data example.

hth,
Z